I made 1 more correction to the function (see below). If we don’t check query_vars array for tag data presence, it affects the side-bar widgets like recent posts block. This fixes that issue.
if ( is_tag() )
{
if( $query->query_vars['tag'] !== "" )
$query->set( 'orderby', 'comment_count' );
}
return $query;
Perfect. Works like a charm.
Thanks.
Thanks Simion. So if I do the short-code method, then I have to enable the VC plugin for all single pages – correct?
Hi Simion, Thanks for the reply.
I’m looking for a simple fix without any extra plugin. Could you tell me where the loop for tag page is located? Is that in includes/wp_booster/td_data_source.php module where I could adjust the order by in wp_query object?
Could you please tell me where can I find that piece of code that picks up the posts for a given tag page?
Thanks, JK
Hi Simion,
After a lot of trial and error, I achieved what I wanted with NP theme itself but just 1 caveat (I had to lose the sticky smart sidebar feature).
This custom CSS does the magic.
@media (max-width: 1018px) and (min-width: 768px)
{
.td-pb-row [class*="td-pb-span8"] {
padding-right: 14px;
padding-left: 14px;
width: 100%;
}
.td-pb-span4 {
width: 324px;
}
}
I think I need some customizations to js/tagdiv_theme.js file to handle the stickiness around this section of the code:
if (tdUtil.getBackendVar('tds_smart_sidebar') == 'enabled' && tdDetect.isIos === false) {
Basically if we can avoid sticky sidebar if the width is between 768 & 1018 in this code section, I think I’ll be all set.
Could you show me a piece of code that does the check for the screen size in jquery and not trigger the event for scroll-up.
Let me know if this makes any sense.
Thanks, JK
-
This reply was modified 8 years by
jkfriends.
Hi Simion,
One of the ad networks that I plan to partner with has this requirement. As the browser resizing action happens, the sidebar width shrinks and that will show cut-up ad which violates their ad-policy rules. The ad network wants to be loyal for their advertisers to show their ads in full size. If 300px can’t be displayed, then it should fall to the bottom of the page.
It is a real disappointment that NP doesn’t support this. Now I have to research another theme in the market which does this for me.
Thanks.
Hi Simion,
Thanks for the reply. The array $defaults is getting initialized below that line of code (comment_form($defaults)).
How will that work? Should we also move all initialization of $defaults array before that line?
Let me know.
Thanks.
Could you share what module needs to be changed for this?
At last I figured out. I had a function (via init hook) that was excluding the custom post type (product) from search – it mistakenly took out the product category page listing as well. So I rearranged the function to exclude custom post type (product) only from search. Now it is all better.
We can close this thread.
Thanks.
Any suggestion as what could be it in child theme? Note that I made the child theme when I was in NP6 level. Do I need to recreate it to match with NP8?
I had 2 modified files in woocommerce/single-product.php & archive-product.php.
Anything that I have to differently in NP8 now?
Thanks.
Thank you very Bogdan. It was with the child-theme – the moment I switch over the main NP 8 theme, it started to work. I will debug as why the child-theme is causing this.
Thanks again.
Hi Bogdan,
The product category page looks like this: site.com/product-category/books
I get that message – No products were found matching your selection.
If it is plugin incompatibility, then I assume that it wouldn’t work with the WP 2017 default theme as well but it works with that.
Could you provide me guidance as what module in NP8 that controls the display of product category page?
Thanks.