• I am trying to use wordpress as a CMS for my site. I have everything built with a static home page and pages with subs for content.

    This worked fine until I need a section for News or Links which it would be great to add to these pages by just posting to a matching catagory?

    Can any one tell me how to add posts from an individual catagory to a dynamic page if the page ID matches?

    Or am I going about this the wrong way and I should be using separate Catagory pages with sticky posts or something instead?

    Please help

Viewing 4 replies - 1 through 4 (of 4 total)
  • I’m not sure I understand you. You can automagically use WordPress’ Category Pages to return only the posts for that category.
    Wordpress makes these automatically. It depends on your permalink structure what the link to them is. If you want to customize different category pages differently, look at this page: https://codex.www.ads-software.com/Category_Templates

    If you want to display posts from a certain category on a particular non-category page, you have to put in a new Loop filtering for that cat. This is the basic skeleton:

    <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
    <?php if ( in_category($your_page_id) ) { ?>
    <?php the_title(); ?>
    <?php the_content(); } ?>
    <?php endif; ?>

    with your formatting and HTML structure going around all that etc.

    Thread Starter flipper26

    (@flipper26)

    I am not using catagories at all just pages at the moment, which works great will a static homepage. I just wanted to add some post-catagories on the bottom of a few pages? I am currently editing page.php to try and do so.

    I would rather not have to rework the whole site and menu to posts and catagories if possible?

    Don’t mix posts and Pages – if you want to keep your sanity ??
    Pages are designed to display only ONE entry’s content.

    …usually without categories and datastampts.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Pages with catagory additions?’ is closed to new replies.