Support » Plugins » Displaying posts in pages

  • Hi,

    Is there a way of displaying posts in pages. That is, in WP it is possible to setup “static” pages, and with a plugin I’m allowed to write php in the content area of a page. However doing simple copy-paste from the index page does not display any posts.

    My objective here is to have a single page for each category of posts in addition to an initial text on each page.

    Any suggestions?

Viewing 15 replies - 1 through 15 (of 31 total)
  • You do not need any plugin to put “content” into your pages. Just use the Write Page admin panel.
    I don’t really understand what are you after with the single Pages. Could you, please, re-phrase it?

    If you mean that you’d like some sort of introduction to each category (“Posts about web design”) and then the posts after it like in a regular archive, you could get the initial text for categories with <?php category_description(); ?> without having to make extra pages (the description is written in the Category’s properties). For example this is what I do in Archive Template:
    <div id="intro">
    <?php if (is_category()) { ?>
    <h1><?php single_cat_title('',true); ?></h1>
    <?php echo category_description(); ?>
    <?php } ?>

    (that goes before the if (have_posts()) etc. part)


    guess I was a bit difficult to understand…

    I want to display posts from a certain category on a single page, and posts from amother category from another page. Then secondly I will create (this I have done) a menu displaying all my pages…

    So it is not the pure content thats my problem – it is displaying posts on other pages than the main page

    hope I’m understandable 🙂

    By default displaying posts from a category WP uses the archive.php template. See Template Hierarchy.
    You can also create Category Templates for you categories:

    Sure I could use categories for this – but then the problem is the menu system. I would then like to have a main menu displaying all categories (easy) – but also a submenu displaying all subcategories in a certain category!

    In fact this would be easier since it goes hand in hand with my “MarsEdit”. But I still haven’t figured out how to display all subcategories when displaying a category….

    OK, thanx for the input!
    It actually did help! However, for my needs, not completely!

    Thus, I still would like an answer to the following question (which is not meant philiosophically):

    ** Can I display dynamic content–such as posts–on a static page in wordpress?

    Tricky question, LOL
    Despite their name the Pages actually are dynamic, since their content is stored in the DB.
    There is also a lot of info here in the forum if you do a search for “category template”.

    NO NO NO!!! He is just asking how do you put in the loop posts (wich are time dependent) inside a template page..

    From what I have gathered it is not possible. The loop will get the post as the page content.

    For example, I would like to create many a diferent view to index.php to my posts wich exists at same time as index.php… Or to acess the post list from a page…

    I would like someone to really clarify me on this situation…

    I’ve been thinking about doing something along these lines also, jetlund. I’m not sure if this will work, but here’s what I would try:

    1) Make a copy of your index.php page and name it “something.php”.
    2) Copy and paste the following code at the top of the something.php page you have just made:
    Template Name: Whatever You Want To Call It

    This will allow you to use this as a template for your page(s).
    3) To restrict the post on something.php to one category, enter this code at the top of this page:
    if (empty($_SERVER['QUERY_STRING'])) {
    $cat = 'numberofcategory';

    /* Don't remove this line. */
    4) Create a new page in your admin section (Write>Write Page). On the Page Template: dropdown menu, select the template you just created (“Whatever You Want To Call It”, in this example).

    Like I said, I’m not sure if it will work, but that’s where I’d start. I hope that helps.

    You might find these links helpful as well:

    Hmm, I just tried that myself and it doesn’t work. As Aife said, the loop pulls the text you enter into the page content instead of posts from the category you want. I have no idea how to do it, then…I guess you’d have to find a way to distinguish between a “standard” post and the page content.

    Look here on setting up custom “multiple” loops:

    Specifically look at the info on how to use query_posts and WP_Query, which is what you’re looking for to set up custom post queries in your Page template.

    I am trying to do something along the same lines as jetlund.
    Basically, I want to have a page which will display posts only meant for that page, and not visible in the normal post index. I have been trying a few things, and I will keep you posted on my progress.

    What I have achieved is this:
    Copy the index.php to foo.php (for example) and then switching off the themes flag to false.

    /* Short and sweet */
    define(‘WP_USE_THEMES’, false);

    Next you add the template you would like to use.
    From here you can call all the function available to the index template.
    The other pages (404.php and the like) will be from the themes but you will have a diferent take on the loop with posts.

    You end not having posts in a page per se, but still can make a pseudo-page with posts.

Viewing 15 replies - 1 through 15 (of 31 total)
  • The topic ‘Displaying posts in pages’ is closed to new replies.