Support » Theme: Argent » Can not see comments

  • Resolved tradesouthwest

    (@tradesouthwestgmailcom)


    The comments do not show nor does an option to post a comment show for the blog page posts; public view or logged in. (Standard Post type or link or any other post type.) Tried:
    * Screen Options – turn on Comments, discussion and enabled both for post.
    * Reading: Static and Latest Posts
    * General: Anyone can register
    * Discussion: Allow people to post comments on new articles
    * added get_comments(); to several templates and template parts
    * checked forums and WP.org codex
    * Customizer….
    * Dashboard (approve?)

Viewing 11 replies - 1 through 11 (of 11 total)
  • tradesouthwest

    (@tradesouthwestgmailcom)

    Also tried:
    * Theme Options, turn on and turn off Show Portfolio Section
    – There are no plugins except WP Spam shield and Contact form 7
    – Jet Pack is NOT installed

    Hi, i just installed the theme and i can see the comments section, did you try with all your plugins disabled?

    tradesouthwest

    (@tradesouthwestgmailcom)

    Yes… I even double checked if I added display: none to comments, as I do some times on a theme.
    When I switch to default twenty-fifteen theme the link shows to add a comment, “Leave a comment” but I do not even get that much with Argent.

    Do you have any idea what these are:
    script window._wpemojiSettings
    style img.wp-smiley, img.emoji {}

    they are in the header. I have no idea where they came from. Might be a WP core element for images on canvas….

    tradesouthwest

    (@tradesouthwestgmailcom)

    Is there anyway to add a raw get_comments() to the content? I can not decipher where the content templates reference the post_types. Maybe that would be the easy solution.

    tradesouthwest

    (@tradesouthwestgmailcom)

    I can add this but all I get is the word comment and it is not linkable (no link to comment).

    $comments_args = array(
    'title_reply'=>'Comment',
    );
    comment_form($comments_args);

    Also I tied adding various forms of comment_template() get_comments_link() etc.

    It seems like there is part of the post template missing… maybe?

    <?php
    					// If comments are open or we have at least one comment, load up the comment template
    					if ( comments_open() || get_comments_number() ) :
    						comments_template();
    					endif;
    ?>

    this is the comments code from the page.php and this is how the single.php looks

    get_header(); ?>
    
    	<div id="primary" class="content-area">
    		<main id="main" class="site-main" role="main">
    
    		<?php while ( have_posts() ) : the_post(); ?>
    
    			<?php get_template_part( 'content', 'single' ); ?>
    
    			<?php
    				// If comments are open or we have at least one comment, load up the comment template
    				if ( comments_open() || get_comments_number() ) :
    					comments_template();
    				endif;
    			?>
    
    			<?php the_post_navigation(); ?>
    
    		<?php endwhile; // end of the loop. ?>
    
    		</main><!-- #main -->
    	</div><!-- #primary -->
    
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    you can download a fresh copy of the theme and restore any code it’s missing (not recommended).

    tradesouthwest

    (@tradesouthwestgmailcom)

    OK. The comments link or popup link I think it is called does not show on the blog page for each post (excerpt or full text). Most all themes have a way to show the number of comments and even display a link to the comments on the blog page, within the header or footer of each post (postmetadata).

    I would be satisfied with this type of solution. comments_popup_link() or anything similar does not show up on the blog page, if I add function call to the page or content-page templates.

    So basically there is no way to see if there are comments for a post without clicking on the post title. Most people will not know it is a blog or it is open for comments if the comments link does not display.

    Here is an example of ALL I get on a post (excerpt – short example)

    Hello Earth
    POSTED ON 10/14/2015
    newpost to test blog settings

    That is it. title, metadata, post. Do you know what function call and what template I can add a comments (count) link to? Maybe even more metadata to header/footer.

    Moderator stephencottontail

    (@stephencottontail)

    Looks like it’s a little bug with the theme. There’s a function defined in inc/template-tags.php named argent_entry_meta() which calls comments_popup_link():

    if ( ! is_single() && ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
      echo '<span class="comments-link">';
      comments_popup_link( esc_html__( 'Leave a comment', 'argent' ), esc_html__( '1 Comment', 'argent' ), esc_html__( '% Comments', 'argent' ) );
      echo '</span>';
    }

    But it’s only called from content-single.php and the conditional says ! is_single(), so, um, oops.

    The function is pluggable, so you could fix this in a child theme by defining another function named argent_entry_meta(), and the child theme’s function would be used instead. You could also display this information on your archive pages by making a copy of content.php in your child theme and calling argent_entry_meta() from there.

    tradesouthwest

    (@tradesouthwestgmailcom)

    Sounds like a plan. I figured there was at least a tiny bug in it somewhere. Usually I can find them fast(er) but I did not have a lot of time to spend on navigating the functions for your theme.

    I really appreciate your fast and comprehensive responses and will let you know if I get it working the way I expected it to work. You can set this ticket as complete/resolved. I will start a new thread if there are any further issues.

    tradesouthwest

    (@tradesouthwestgmailcom)

    I simply did this to content.php:

    <div class="entry-content">
    		<?php the_excerpt(); comments_popup_link(); ?>
    	</div><!-- .entry-content -->

    works like a charm.

    Moderator Kathryn

    (@zoonini)

    Automattic Happiness Engineer

    Glad you found a workaround to get Argent displaying how you’d like. The way Argent displays the blog page without a comment link – as you can see on the demo https://argentdemo.wordpress.com/blog/ – is a stylistic choice made by the theme’s creator to keep the blog page clean, as opposed to a bug. It’s great to have your tweak documented here in case anyone else would like to make the same change!

    Just a heads-up that you should definitely make the content.php edit in a child theme if you haven’t already, otherwise you’ll lose your tweak every time you update the theme to the latest version.

    Here are some guides in case you haven’t made one before:

    http://codex.wordpress.org/Child_Themes
    http://op111.net/53/

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Can not see comments’ is closed to new replies.