Tagged: Remove Commented Posts, TH: Posts Tabs
- This topic has 3 replies, 2 voices, and was last updated 4 years, 4 months ago by Theme Horse Support Team.
-
AuthorPosts
-
July 11, 2020 at 11:42 pm #79310July 13, 2020 at 3:18 pm #79328Theme Horse Support TeamKeymaster
Hi webadmin,
Thank you for appreciating our Theme. 😉
Yes the Popular Tab is not made controllable. The posts in it is Order by most comment counts and if the comment is not yet then the post will be Order By Random way. And yes you have to customize the Code to hide ‘Commented Tab’.
If you want to hide the Commented Tab then Please go to Theme Directory > inc > newscard-widgets.php and remove the codes from line no 947 to 949 and from line no: 1030 to 1076.
Codes to be removed on Line 947 to 949 is.
<li class="nav-item"> <a class="nav-link widget-title" data-toggle="tab" href="#post_tabs_commented_<?php echo esc_attr($this->number); ?>" role="tab"><?php esc_html_e('Commented','newscard'); ?></a> </li>
Codes to be removed on Line on 1030 to 1076 is
<div class="tab-pane fade" id="post_tabs_commented_<?php echo esc_attr($this->number); ?>" role="tabpanel"> <div class="row gutter-parent-14"> <?php if ($number > 0) { $get_commented_posts = array( 'number' => $number, 'status' => 'approve', ); $comments_query = new WP_Comment_Query(); $comments = $comments_query->query( $get_commented_posts ); if ( $comments ) { foreach ($comments as $comment) { ?> <div class="col-md-6 post-col"> <div class="post-boxed inlined clearfix"> <div class="post-img-wrap"> <a href="<?php echo esc_url(get_permalink($comment->comment_post_ID)) . '#comment-' . $comment->comment_ID; ?>" class="post-img" style="background-image: url('<?php echo esc_url( get_avatar_url($comment->comment_author_email) ); ?>');"></a> </div> <div class="post-content"> <div class="entry-meta category-meta"> <div class="cat-links"><?php echo esc_html( newscard_post_categories_display() ); ?></div> </div><!-- .entry-meta --> <h3 class="entry-title"> <a href="<?php echo esc_url(get_permalink($comment->comment_post_ID)) . '#comment-' . $comment->comment_ID; ?>"> <?php echo get_the_title($comment->comment_post_ID); ?> </a> </h3><!-- .entry-title --> <div class="entry-meta"> <div class="date"> <a href="<?php echo esc_url(get_permalink($comment->comment_post_ID)) . '#comment-' . $comment->comment_ID; ?>"> <?php echo esc_html(get_the_time(get_option('date_format'))); ?> </a> </div> <div class="by-author vcard author"> <a href="<?php echo esc_url(get_permalink($comment->comment_post_ID)) . '#comment-' . $comment->comment_ID; ?>"> <?php the_author(); ?> </a> </div> </div> </div> </div><!-- post-boxed --> </div><!-- col-md-6 --> <?php } } } ?> </div><!-- .row .gutter-parent-14--> </div><!-- .tab-pane -->
Note: We recommend you to first make the Child theme so that your Customized codes wont get lost when you update the Theme to new Version.
July 13, 2020 at 3:23 pm #79329webadminParticipantThanks! My site doesn’t utilize comments so it sounds like the Popular Tab won’t work for me either then. When I made a Child Theme I found the site width to change despite my not entering any custom CSS (other than to reference the original as common in the Child Theme creation process). Do you know why that is? I feel like I must have done something wrong or need to adjust a parameter. You probably know what that would be.
July 13, 2020 at 5:45 pm #79339Theme Horse Support TeamKeymasterIf the comment is not made available on your Site then the Popular Tab will show the Random Posts or you can use the normal TH Recent Posts instead of TH Posts Tab Widget.
For the width issue on child theme you might have not maintain all of the parent theme dependencies as this theme have more than 1 CSS file. Please you can check the Link of previous Solution about same Child Theme (here). It might be helpful for you.
Thanks
-
AuthorPosts
- You must be logged in to reply to this topic.