Limit Categories in Twenty Eleven's Showcase Template (2 posts)

  1. Tannador
    Posted 5 years ago #


    I just started using WP as a CMS since I watched http://en.blog.wordpress.com/2011/08/19/growth-of-wordpress/ and got interested.

    I use WP3.2.1 and Twenty Eleven as Theme. The migration went very well but for one thing: how do I display articles of a certain category on a static page?

    I have a static page about travel, a static page about Android and a "normal" Blog. I would like to have the blog articles that I put in the category "travel" displayed on the corresponding static page and the same for Android.
    It seems to me that the Showcase Template is the way to go, but I haven't found any way to limit the stream to a certain category (or to change the header of the stream for that matter).

    Is there a plug-in to solve this or at least some how-to on code manipulation? I am a PhD student of computer science, however, my field of expertise is assembly code verification of embedded systems not CSS or PHP. So be gentle ;)

    Currently, I use static links to the articles, which is rather ugly. Thanks for your time and help.

  2. jeffmcnear
    Posted 4 years ago #

    One approach would be to create a page template that would call posts from a particular category of posts. Try inserting the following at the position desired:
    global $post;
    $args = array( 'numberposts' => 5, 'offset'=> 0, 'category_name' => 'your-category-name', 'orderby' => 'post_date', 'order' => 'DSC');
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) : setup_postdata($post); ?>

  3. " rel="bookmark" title="<?php _e('Permanent Link to '); ?><?php the_title(); ?>"><?php the_post_thumbnail( 'thumbnail' ); ?><?php the_title(); ?></h1>
    <p><?php the_excerpt(); ?></p>
    <p>">...read more</p>
  4. "
    If your "page" content is modest you could simply populate the category description with that content, and connect a category rather than a page to the navigation item

Topic Closed

This topic has been closed to new replies.

About this Topic