Site icon Hip-Hop Website Design and Development

Exclude a selected put up in a Customized Publish Kind

I’ve a quite simple question to show all my posts in a customized put up kind:

<?php
    $web page = get_page_by_title('Duck');
    $args = array(
        'post_type' => 'periods',
        'post__not_in' => array($page->ID)
    );
    $question = new WP_Query( $args );
?>

<?php if ( $query->have_posts() ) { ?>
    <ul>
        <?php whereas ( $query->have_posts() ) { $query->the_post(); ?>
            <li>
                <?php the_title(); ?>
                <?php the_content(); ?>
            </li>
        <?php } ?>
    </ul>
<?php } ?>

<?php wp_reset_postdata(); ?>

What I wish to do is show all of the posts besides the "Duck" put up, I am getting it is ID by it is title – which usually is not an issue, however the question nonetheless reveals this put up. I am guessing I am simply not going about this the proper means.

Can anybody assist me out right here, I used to be additionally pondering exclude > $page->IDor one thing like that – which is what I might do in an everyday loop…simply unsure the best way to do it in a Customized Publish Kind.

Thanks,
Josh