• seekingsolace

    (@seekingsolace)


    I have a template that I uploaded that has no single.php file or page.php file; all it has is comments.php, index.php, and style.css.

    There’s code at the bottom of every post (in the loop) in index.php to add a little icon and the number of comments posted so far. This works great when you select a category; all the posts in “News” show “[icon] Comments (0)” at the bottom. But when you look at a page by itself or a post by itself, all it displays is the icon, with no text, no matter how many comments have been posted.

    The code at the bottom of the loop is as follows:

    <div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> by <?php the_author() ?> at <?php the_time() ?> <?php wp_link_pages('before= | '); ?> <?php edit_post_link(__('Edit This')); ?></div>
    <?php if ( comments_open() ) : ?>
    <div class="feedback">
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    </div>
    <?php endif; ?>

    The class “feedback” in style.css reads like this:

    .feedback { padding: 0 0 0 16px; background: url(images/tulipicon.gif) no-repeat 0px 1px; height: 15px; font-size: 10px; text-align: left; text-decoration: none; margin-bottom: 5px; }

    So, the icon is displayed through the style class, rather than hard-coded. But I can’t imagine why that would interfere with displaying the text in a single post view, especially since the Template Hierarchy says it should go right back to the index file, since no single.php exists.

    Any ideas?

  • The topic ‘Problem with index.php when showing single post’ is closed to new replies.