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*

TH: Posts Tabs

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #79310
    webadmin
    Participant

    Hello,

    Wonderful work on this theme! 2 questions for you–

    1) I’m assuming the widget TH: Posts Tabs calculates for the content that displays under popular, correct? If so, how does this work because it does not match my site’s statistics and view counts by post. I know the sample named popular on the homepage was setup as a static category so I wouldn’t expect that to display the same output results but I was just curious where your widget is getting its data from because there are no parameters to control the tab categories so I figure what it is showing as “popular” must be deemed so only it actually is not; it’s a bit random. Is there a way to sync/link that data up so the view counts on the post match what’s considered “popular”? Is the issue that I newly installed the theme into an existing site and just need to let it tabulate over time from here forward?

    2) Is there a way to hide the comments tab if I don’t allow comments? Would this be something I should do using a child theme?

    #79328

    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.

    #79329
    webadmin
    Participant

    Thanks! 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.

    #79339

    If 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

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