• Hey, strange problem that I’m having trouble searching for..

    I’d like to show a single post on the home page. It should be:

    1. The most recent post from the children of a parent category.. and:
    2. Exclude posts from certain predefined categories.

    The code I have so far is:

    global $post;
    $args = array( 'numberposts' => 1, 'category' => 174 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) :	setup_postdata($post); ?>

    I’m having trouble excluding the two categories I want to be ignored.. any help greatly appreciated!

    Thanks,

    Toby

  • The topic ‘Custom Query to Show Specific Post’ is closed to new replies.