• Resolved benbarber

    (@benbarber)


    I am using this page template below and it works fine but if a post uses the <!more!> Tag it just shows the whole post, and the More tag is not displayed. How can I overcome this little niggle as its so anoying!

    My page template:


    <?php
    /*
    Template Name: Blog
    */
    ?>

    <?php
    query_posts('cat=-0'); //gets all posts
    load_template( TEMPLATEPATH . '/index.php'); //loads index
    ?>

    Please help me!!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The more tag does NOT work on Pages – it just wouldn’t make sense. On Pages only one post is supposed to be displayed, so, no need for “more”.

    I agree it doesn’t make sense. However, this is just PHP…

    http://wordpress.org/support/topic/67173#post-355528

    Thread Starter benbarber

    (@benbarber)

    OK Your right.. but what I was after is having my blog located in its own section ie mydomain.com/blog and not having the blog as the main page for which I am using a home.php template.

    Anyway this problem is now solved. many thanks to Kafkaesqui for the link to the infromation.

    All I had to do was add $more = 0; to my blog.php page tmeplate file so it now looks like this:


    <?php
    /*
    Template Name: Blog
    */
    ?>

    <?php

    query_posts('cat=-0'); //gets all posts

    $more = 0; // Enables the More tag to function within page

    load_template( TEMPLATEPATH . '/index.php'); //loads index

    ?>

    Creating a new page called blog and selecting it to use this blog.php template, will enable the page to act as your main blog showing all post and the more tag working properly.

    I am glad it worked for you. However, for future reference:
    but what I was after is having my blog located in its own section ie mydomain.com/blog
    – Isn’t less complicated to install WP in the “blog” directory in a similar case?

    Good info. And Mosh, this would allow you to easily edit the page using wordpress as a CMS, and also allow you to search throughout your entire website.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘More Tag with query_posts HELP PLEASE!!’ is closed to new replies.