badget

Biggest Sale! Special Offer!

Get 30% discount on all of our single themes with this coupon code: #30%SALE

Hurry up! *Limited time offer*

How to remove “No comment “ from appearing in search results

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #78650
    john
    Participant

    I have used a the css you gave to prevent no comments from appearing on my site but “No comment” is still appearing in search results. How do i stop that?

    #78673
    john
    Participant

    hello i’m still waiting for your feedback

    #78679

    We have checked and its working well, could you please share you the exact search result page where the ‘No Comment’ is showing.

    Thanks

    #78682
    john
    Participant

    All my post pages. Take a look Pages

    #78724
    john
    Participant

    I’m still waiting

    #78736

    Hi John,

    We will update this into next version update till then follow the instruction below which disable the no-comment links if there is 0 comment:

    Just go to theme directory > template-parts > content.php on line no: 64 and in content-search.php on line no: 45 you will find below line of code:

    <?php if ( comments_open() ) { ?>

    just replace above mentioned code to the below one.

    <?php if ( comments_open() && get_comments_number() ) { ?>

    Thank you!

    #78742
    john
    Participant

    Even if there are comments, I do not want the comment numbers to display in search results either.

    #78771

    Then remove the below mentioned code that you will find on content.php page line 64 to 68 and content-search.php page line 45 to 49.

    <?php if ( comments_open() ) { ?>
    	<div class="comments">
    		<?php comments_popup_link( __('No Comments', 'newscard'), __('1 Comment', 'newscard'), __('% Comments', 'newscard'), '', __('Comments Off', 'newscard') ); ?>
    	</div><!-- .comments -->
    <?php } ?>

    Note: we recommend you to customize the code after making a child theme so that you won’t loose any customized code when you update the new to a new version in future.

    Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.