1

I have my Reading settings set to Static pages and blog is set to a page called What's New.

When I go to this What's New page I can see the post content but the post title with link to post page is not displaying. I can only see the post content.

I have done everything I can think of to find the error, with no luck, please help!

Code for index.php:

<div id="content" class="narrowcolumn" role="main">
    <?php if (have_posts()) : ?>
        <?php while (have_posts()) : the_post(); ?>
            <div <?php post_class(); ?> id="post-<?php the_ID(); ?>">
                <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php printf(__('Permanent Link to %s'), the_title_attribute('echo=0')); ?>"><?php the_title(); ?></a></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 &raquo;')); ?>
                </div>
                <p class="postmetadata"><?php the_tags(__('Tags:') . ' ', ', ', '<br />'); ?> <?php printf(__('Posted in %s'), get_the_category_list(' ')); ?> | <?php edit_post_link(__('Edit'), '', ' | '); ?>  <?php comments_popup_link(__('No Comments &#187;'), __('1 Comment &#187;'), __('% Comments &#187;''), '', __('Comments Closed') ); ?></p>
            </div>
        <?php endwhile; ?>

I'm not sure if it's relevant but I have the commented out on the page template.

Code for whats-new.php:

<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post" id="post-<?php the_ID(); ?>">
        <h1><?php the_title(); ?></h1>
            <div class="entry">
                <?php the_content(''); ?>
            </div>
        </div>
</div>
<?php endwhile; endif; ?>

I hope someone can help! If you have any ideas they're much appreciated. I've tried removing parts of my functions file, making the blog the home page under settings, and so other stuff.

Any ideas?

3
  • 4
    The grayed-out text in your 2nd code block means that whatever it's there is ignored by the browser, and guess what? It just happens to be the title Jun 27, 2011 at 5:27
  • Yes, thanks! I have tried removing those comments and it has no effect. Still doesn't show the title.
    – talkingD0G
    Jun 27, 2011 at 23:51
  • Did you ever find the solution to your problem?
    – tacudtap
    Feb 16, 2015 at 1:30

2 Answers 2

1

Remove the <!-- --> in <!--<h1><?php the_title(); ?></h1>--> these are html comments so it won't get displayed.

1
  • I did try removing them and it had no effect.
    – talkingD0G
    Jun 27, 2011 at 23:50
1

This was possibly that your page was set to be an "Aside" not a "Standard" post in the options at the side.

That caused the problem you describe for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.