Forums

How to pull content from the DB (2 posts)

  1. sixfootjames
    Member
    Posted 4 months ago #

    Hi,

    I am using the method below to pull content from the DB based on the category but I would prefer to pull the content from a specific post so that the end user of the CMS does not accidentally overwrite a specific piece of content if they choose the wrong category.

    <?php
    query_posts('cat=15&posts_per_page=1');
    if (have_posts()) : while (have_posts()) : the_post();?>
    <?php the_content();
    endwhile; endif;
    ?>

    Any help will be appreciated.

    Many thanks,
    James

  2. sixfootjames
    Member
    Posted 4 months ago #

    query_posts( 'p=5' );

    Seems to do the trick :)

Reply

You must log in to post.

About this Topic