Blog or category layout

  • Author
    Posts
  • #28326
    Cassandra

    How do you select a specific category of posts to show up on a page rather then all of them?

    #28434
    Luiz Gonzaga Jr

    Hi , it´s easy to resolve Cassandra…. just go to content-frontpage.php file .

    There you will find

    /* Start the Loop */
    $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1;
    $the_query = new WP_Query( array(‘posts_per_page’=>$temperas[‘tempera_frontpostscount’],’paged’=> $paged) );
    while ( $the_query->have_posts() ) : $the_query->the_post();

    And replace for this

    /* Start the Loop */
    $paged = ( get_query_var(‘paged’) ) ? get_query_var(‘paged’) : 1;
    $the_query = new WP_Query( array(‘posts_per_page’=>$temperas[‘tempera_frontpostscount’],’cat’=> 1 , ‘paged’=> $paged) );
    while ( $the_query->have_posts() ) : $the_query->the_post();

    Notice you now have a ‘cat’=> 1 , one means the number of the category you want to show up..

    Bye

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Blog or category layout’ is closed to new replies.