WordPress.org

Ready to get started?Download WordPress

Forums

Categories Posts inside Pages Plugin (5 posts)

  1. danouma
    Member
    Posted 5 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.

    Cheers.

    Danouma.

  2. MichaelH
    Member
    Posted 5 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; ?>

    Resources:

    Stepping Into Templates
    Template Hierarchy
    Template Tags
    query_posts()

  3. cmsme
    Member
    Posted 5 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
    Member
    Posted 5 years ago #

    This guy did it!


    http://www.strikemma.com/category/videos/

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

  5. lightbulb
    Member
    Posted 5 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