WordPress.org

Ready to get started?Download WordPress

Forums

Comment link missing? (9 posts)

  1. fmofmpls
    Member
    Posted 2 years ago #

    Hello. My comment link seems to be missing at the bottom of each post. Can anybody please assist me with this? I'm using the Raindrops theme. I've searched the forums, but still seem to be at a loss? Also a newbie, so please excuse my ignorance.

    Blog - http://universalmonsterarmy.com/blog/

    Thanks for the assistance!

  2. Lisa Sabin-Wilson
    Member
    Posted 2 years ago #

    Sounds like the link is not included in the index.php of your theme?

    Open your index.php template file for the Raindrops theme and look for this line of code (or something very similar):

    <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>

    If you don't see it, add it wherever you'd like the comments link to appear on your site.

  3. fmofmpls
    Member
    Posted 2 years ago #

    Thanks for the reply! Can't find it anywhere in the index.php file.

    Here's what it looks like:

    <?php
    /**
    * The xhtml1.0 transitional header for our theme.
    *
    *
    * @package WordPress
    * @subpackage Raindrops
    * @since Raindrops 0.1
    */
    get_header("xhtml1"); ?>
    <?php if(WP_DEBUG == true){echo '<!--'.basename(__FILE__,'.php').'['.basename(dirname(__FILE__)).']-->';}?>

    <div id="yui-main">
    <div class="yui-b">
    <?php
    /**
    * Widget only home
    *
    */
    if ( is_home() and is_active_sidebar('sidebar-3') ) {
    echo '<div class="topsidebar">'."\n".'

      ';
      dynamic_sidebar('sidebar-3');
      echo '
    '."\n".'</div>'."\n".'<br class="clear" />';
    } ?>

    <div class="<?php echo raindrops_yui_class_modify();?>" id="container">
    <div class="yui-u first" <?php is_2col_raindrops('style="width:99%;"');?>>
    <?php get_template_part( 'loop', 'default' );?>
    <br style="clear:both" />
    </div>
    <div class="yui-u"><?php if($rsidebar_show){get_sidebar('extra');} ?></div>
    <?php //add nest grid here?>
    </div>
    </div>
    </div>
    <div class="yui-b"> <?php get_sidebar('default'); ?></div>
    </div>
    <?php get_footer(); ?>

  4. Lisa Sabin-Wilson
    Member
    Posted 2 years ago #

    Based on that output - look in the template file called loop.php or loop-default.php (or both) and copy and then paste the line of code that I gave you in my previous response into the template at the location you would like it to display on your site.

    <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>

    PS - when posting code in the forums - put the code between backticks so they are formatted correctly :)

  5. fmofmpls
    Member
    Posted 2 years ago #

    Thanks Lisa for the great support. I took your advice and placed the code at the very end of loop.php

    It seemed to work for the first post, but didn't show itself with the second (most recent) post? Any idea on where this should be placed within the file so it will remain consistent?

    Here's my loop.php file with backticks included this time.

    [code moderated - for any code longer than 10 lines, please use the http://pastebin.com/ as explained in http://codex.wordpress.org/Forum_Welcome#Posting_Code ]

  6. saeedqs
    Member
    Posted 2 years ago #

    @Lisa Sabin-Wilson
    hi
    i think comment function should be used

  7. fmofmpls
    Member
    Posted 2 years ago #

    Without sounding greedy, what I'd really like to see in a perfect world is for the comments link to show as well as a "leave a comment" link to show at the end of each and every post.

    I would be eternally grateful for further assistance!

    Best, Terry.

    http://universalmonsterarmy.com/blog/

  8. Lisa Sabin-Wilson
    Member
    Posted 2 years ago #

    Since your code was moderated above, I cannot see your exact structure, so here is an example from a template I have:

    <?php the_time(get_option('date_format')); ?>
    <?php the_author_posts_link(); ?>
    <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?>

    That lists, in order: the date | the author | comments

    The comments_popup_link needs to be placed within the loop, which is probably why you are seeing it listed for the first post, but not on subsequent posts.

    If you want to edit the text that shows for your comment links, you would edit the text within the comments_popup_link parenthesis - example:

    <?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?>

    That will display if:

    There are no comments yet: "Leave a Comment"
    There is only one comment: "1 Comment"
    There are several (like 10): "10 Comments"

    Hope that helps.

  9. fmofmpls
    Member
    Posted 2 years ago #

    Thanks Lisa that does help some. I'm almost there, but still need a little more tweaking.

    I couldn't really find the exact code structure you instructed me to look for, so I inserted the comment code where it looked to me to be the most similar. I ended up with the comments link appearing above the post title; not horrible, but probably better placed at the end of the post.

    Here's my loop.php code via Pastebin - http://pastebin.com/VA5q7jbJ
    P.S. I inserted the comment code on line 50.

    Here's a screen grab of how the comments link is appearing on my blog - http://i52.tinypic.com/9hutye.jpg

    A very big thank you for assisting me with this!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.