Why no comment link under blog posts? How to add it?

Viewing 5 posts - 1 through 5 (of 5 total)
  • #16846
    Lisa
    Participant

    I removed the “excerpt” feature on my blog, so it now basically shows full posts. The thing is, there’s a little menu underneath each post that shows “author”, “date”, “category”, “edit”, and “permalink” … but no “comment” link for people to click. I find this quite crucial.

    I know the comment option is there when you click on each individual post. But looking over the main blog page, it’s not obvious that there’s even a comment section at all.

    Does anyone know how I can add it? The coding of this particular theme is a little more complicated than what I’ve dealt with so far. I’m not even sure which php file I should modify for this.

    #16879
    Daniel Tara
    Keymaster

    You can find the links below each post in functions.php inside the pinboard_entry_meta() function. The function you need to insert theme is comments_popup_link().

    #17166
    Lisa
    Participant

    Thanks Daniel, but I don’t understand what code exactly I’m supposed to paste? This is the part of coding you are referring to:

    function pinboard_entry_meta() {
    	if( ! pinboard_is_teaser() ) : ?>
    		<aside class="entry-meta">
    			<?php if( is_category( pinboard_get_option( 'portfolio_cat' ) ) || in_category( pinboard_get_option( 'portfolio_cat' ) ) ) : ?>
    				<span class="custom-meta entry-category"><?php the_category( ' / ' ); ?></span>
    				<?php $meta_keys = get_post_meta( get_the_ID() ); ?>
    				<?php foreach( $meta_keys as $meta => $value ) : ?>
    					<?php if( ( '_' != $meta[0] ) && ( 'enclosure' != $meta ) ) : ?>
    						<span class="custom-meta"><strong><?php echo $meta; ?>:</strong> <?php echo $value[0]; ?></span>
    					<?php endif; ?>
    				<?php endforeach; ?>
    			<?php else : ?>
    				<span class="entry-author-link"><?php the_author_posts_link(); ?></span>
    				<?php if( ! is_singular() ) : ?>
    					<span class="entry-date"><a href="<?php echo get_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_time( get_option( 'date_format' ) ); ?></a></span>
    				<?php else : ?>
    					<span class="entry-date"><?php the_time( get_option( 'date_format' ) ); ?></span>
    				<?php endif; ?>
    				<?php if( ! is_attachment() ) : ?>
    				<span class="entry-category"><?php the_category( ', ' ); ?></span>
    				<?php elseif( wp_attachment_is_image() ) : ?>
    					<span class="attachment-size"><a href="<?php echo wp_get_attachment_url(); ?>" title="<?php _e( 'Link to full-size image', 'pinboard' ); ?>"><?php $metadata = wp_get_attachment_metadata(); echo $metadata['width']; ?> &times; <?php echo $metadata['height']; ?></a> <?php _e( 'pixels', 'pinboard' ); ?></span>
    				<?php endif; ?>
    				<?php edit_post_link( __( 'Edit', 'pinboard' ), '<span class="edit-link">', '</span>' ); ?>
    				<?php if( ! is_singular() ) : ?>
    					<span class="entry-permalink"><a href="<?php echo get_permalink(); ?>" rel="bookmark" title="<?php the_title_attribute(); ?>">Permalink</a></span>
    				<?php endif; ?>
    			<?php endif; ?>
    			<div class="clear"></div>
    		</aside><!-- .entry-meta -->
    	<?php endif;
    }

    I understand I’m supposed to paste something in between, but what exactly and where?

    #17174
    Daniel Tara
    Keymaster

    Try inserting it before this line:

    <?php edit_post_link( __( 'Edit', 'pinboard' ), '<span class="edit-link">', '</span>' ); ?>

    wrapped in php tags like this:

    <span class="entry-comments"></span>
    #17181
    Lisa
    Participant

    Awesome, thanks! The code mentioned above didn’t work for me, but for others who might be interested, this is what I put in my code and it works like a charm now πŸ™‚

    <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment' ), __( '1 Comment' ), __( '% Comments' ) ); ?></span>

    Thanks again Daniel!

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

Tagged: , ,

You must be logged in to reply to this topic.