• Resolved jon12345

    (@jon12345)


    Is there a way to display specific category posts on a page?

    e.g. my page name is Ford Mustang. On that page, I would like to display all the posts which have the category Ford Mustang.

    Maybe a plugin or something?

    Thanks,

    Jon

Viewing 5 replies - 1 through 5 (of 5 total)
  • <?php
    $temp = $wp_query;
    $wp_query = null;
    $paged=get_query_var('paged') ? get_query_var('paged') : 1;
    $wp_query = new WP_Query('category_name="Ford Mustang"&posts_per_page=10&paged=$paged');
    while($wp_query->have_posts()): $wp_query->the_post();
     // now put your code here
    endwhile;
    $wp_query = $temp;
    ?>
    Thread Starter jon12345

    (@jon12345)

    Where do I put that code? I created a page called test and posted it in under the html section. Is that wrong?

    create a file page-Ford Mustang.php. Then copy the from page.php and put those code in the new file. Then replace the code.

    Thread Starter jon12345

    (@jon12345)

    Ahh, I am looking for a simpler solution really. Something like a plugin.

    The problem I am trying to overcome is to display full posts in a category archive view. The Embed Chessboard plugin doesn’t show in the category archive view, even though the post text will. The developer said this:

    It looks like wordpress, in the category/tags view does not show the entire post but only an excerpt. Depending on the theme, the excerpt might get stripped from HTML tags. The wordpress embed-chessboard plugin uses the <textarea> and the <iframe> plugin, hence the chessboard display might get broken.

    Some themes allows for configuring the excerpt, for instance the atahualpa theme allows specifying which HTML tags should not be stripped from excerpts. By preserving the <p>, <textarea> and <iframe> tags then the chessboard is properly displayed in the category/tags view.

    So I was hoping to find a workaround for this problem, maybe with a plugin or something. There will be lots of categories and lots of sites using this structure so it needs to be simple.

    This is the page where I want to show the full posts including the chessboard: https://www.morragambit.com/category/morra-gambit-accepted/chicago-defence/

    Note that if you view the posts or this link…

    https://www.morragambit.com/blog/

    …they do show the full chessboard plugin.

    Any ideas?

    Thread Starter jon12345

    (@jon12345)

    I’ve found that using the Frugal theme, I can choose display full content in the archive so sorted now!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display Category posts on a page’ is closed to new replies.