• I have set my installation to use a static page named “home”. I set the blogs page to a page labeled “news” and created that template file in news.php with a standard loop. However we have a problem. Only the content is displayed within this loop – no titles. To get an example visit http://www.quadraliberals.ca/beta/news

    The loop is:


    <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

    <div class="post" id="post-<?php the_ID(); ?>">

    <p><?php the_time('F jS, Y') ?> <!-- by <?php the_author() ?> --></p>

    <h2>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></h2>

    <?php the_content('Read the rest of this entry »'); ?>

    </div>

    <?php endwhile; ?>

    <div class="navigation">
    <div class="alignleft"><?php next_posts_link('« Older Entries') ?></div>
    <div class="alignright"><?php previous_posts_link('Newer Entries »') ?></div>
    </div>

    <?php else : ?>

    <h2 class="center">Not Found</h2>
    <p class="center">Sorry, but you are looking for something that isn't here.</p>
    <?php get_search_form(); ?>

    <?php endif; ?>

Viewing 5 replies - 1 through 5 (of 5 total)
  • I don’t believe the Template, news.php, even though assigned as the Template for the News page, is being used when that page is designated as the Front page displays – Page of Posts. Rather, your theme’s index.php is being used for that.

    You will want to use the Conditional Tag, is_home(), in your index.php, as it returns true when your ‘page of posts’ is being displayed.

    Thread Starter kschembri

    (@kschembri)

    Unfortunately that is not working. My index.php page has the same code as my news.php page. I tried the is_home() in both.

    What happens if you switch to the WordPress Default theme?

    Or deactivate all plugins?

    Thread Starter kschembri

    (@kschembri)

    No plugins are activated. Under the default template it works just fine. HELP

    Very strange. I have a custom theme I developed did the same thing you did but it worked for me. Can you repost your <h2> tag with your link so it doesn’t render the link. This is what I have for mine, looks identical to yours..

    <?php if (have_posts()) : ?>

    <?php while (have_posts()) : the_post(); ?>

    <div <?php post_class() ?> id=”post-<?php the_ID(); ?>”>
    <h2>” rel=”bookmark” title=”Permanent Link to <?php the_title_attribute(); ?>”><?php the_title(); ?></h2>
    <small><?php the_time(‘F jS, Y’) ?> <!– by <?php the_author() ?> –></small>

    <div class=”entry”>
    <?php the_content(‘Read the rest of this entry »’); ?>
    </div>

    <p class=”postmetadata”><?php the_tags(‘Tags: ‘, ‘, ‘, ‘
    ‘); ?> Posted in <?php the_category(‘, ‘) ?> | <?php edit_post_link(‘Edit’, ”, ‘ | ‘); ?> <?php comments_popup_link(‘No Comments »’, ‘1 Comment »’, ‘% Comments »’); ?></p>
    </div>

    <?php endwhile; ?>

    <div class=”navigation”>
    <div class=”alignleft”><?php next_posts_link(‘« Older Entries’) ?></div>
    <div class=”alignright”><?php previous_posts_link(‘Newer Entries »’) ?></div>
    </div>

    <?php else : ?>

    <h2 class=”center”>Not Found</h2>
    <p class=”center”>Sorry, but you are looking for something that isn’t here.</p>
    <?php get_search_form(); ?>

    <?php endif; ?>

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Blog Page while using Static Page?’ is closed to new replies.