The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Categories Posts inside Pages Plugin (5 posts)

  1. danouma
    Posted 7 years ago #

    Hi everyone.

    I Looked around the forum but could not find an answer. Could anyone tell me if a WP plugin exists, that allows the posts of a certain category to appear inside a Page ..? Or If i put it in another context , can one put posts inside a page .? That is when one open the page he will see links of posts related to a specific categopry inside that page.

    Thanks for any help.



  2. MichaelH
    Posted 7 years ago #

    Don't need a plugin. Just need a Page with a Page Template assigned, and a loop similar to this (untested) code:

    <?php $page_query = new WP_Query('post_type=post&cat=47'); ?>
    <?php while ($page_query->have_posts()) : $page_query->the_post(); ?>
    <a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a>
    <?php the_content('Read the rest of this entry &raquo;'); ?>
    <?php endwhile; ?>


    Stepping Into Templates
    Template Hierarchy
    Template Tags

  3. Feathers
    Posted 7 years ago #

    @ MichaelH: I also went down that path to fix this, but it is only half of the solution. When someone clicks on an individual post from your category template, they would lose their place in the site tree, thus dynamic highlighting of the menu bar would disappear for that page.

    I am trying to find a way to mod the nav menu to recognise this, but am stumped.

  4. terrybolas
    Posted 7 years ago #

    This guy did it!


    Why nobody is explaining this in a simple way?!!

  5. lightbulb
    Posted 7 years ago #

    Guys there is an easy solution for this, however, you can only use this plugin if you are not using pretty permalinks. Go to http://aralbalkan.com/wordpress for the plugin.

    If anyone can find a way of doing this but with pretty permalinks I would be grateful

Topic Closed

This topic has been closed to new replies.

About this Topic