• Resolved JohnP

    (@johnp)


    I want a static front page, so am loading index.php from within a blog template as described in the codex:


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

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

    I have not set the static home page yet.

    When I look at index.php directly it displays as expected – items stop at “more”.

    But when I load the blog.php page I get the complete text of every post. How can I prevent this?

Viewing 3 replies - 16 through 18 (of 18 total)
  • A development I’m working on requires several pages, each requiring a different editorial comment in the sidebar. It’s at https://www.smokespeak.com.

    The first, index.php, page lets the <!–more–> tag work. None of the pages linked to by top menu items allow the <!–more–> tag to work. Same code though, contained in sidebar.php!

    Here’s the code…

    <?php rewind_posts(); ?>
    <?php query_posts(‘showposts=1&cat=6’); ?>
    <?php if (have_posts()) : ?>
    <?php while (have_posts()) : the_post(); ?>
    <div id=”editor”>
    <h1>” rel=”bookmark” title=”Permanent Link to <?php the_title(); ?>”><?php the_title(); ?></h1>
    <?php the_content(‘ <more>’); ?>
    </div>
    <?php endwhile; ?>
    <?php else : ?>
    <div class=”editor”>
    <?php _e(“No blog entries could be located. If this error continues then please let me know!”); ?>
    </div>
    <?php endif; ?>

    Further ideas? Also, what file(s)/functions deal with this tag? Where is function code which defines a home/index page to work one way and a single Page to work another?

    Thanks guys!

    Thread Starter JohnP

    (@johnp)

    My problem has been solved even better!

    I finally installed and activated the Filosofo Home-Page Control pluggin, told it I wanted the “News” page to be the blog index, and Bob’s yer uncle!

    My WP-created Page is now at https://www.example.com/ and the standard blog index is at https://www.example.com/news/, just as I wanted. The more tag is functioning perfectly.

    The pluggin is overriding my news_php template with the mini-loop described above.

    I had tried the plugin previously, but that was before I discovered my server wasn’t writing to .htaccess.

    I know this is a resolved topic, but I’m just curious:

    If I
    1) install WordPress in https://example.com/wp/
    2) create a WordPress Page https://example.com/wp/first-page/
    3) create a file https://example.com/index.php that says

    <?php
    header('Location: https://www.example.com/wp/first-page/');
    ?>

    Won’t that solve the problem at hand? Nice and easy?

Viewing 3 replies - 16 through 18 (of 18 total)
  • The topic ‘<!–more–> fails when index loads from template’ is closed to new replies.