Show slideshow at the top of each category page layout

March 2014 WordPress Theme
GK User
Fri Feb 06, 2015 11:30 am
Hi there, is there any possible way using say a filter or hook to display a slideshow widget News Show Pro on the top of each category page showing the featured posts from that category like on a page like so: http://www.jamjosandbox.com/magazine/category/politics/

This is what I need on my site, basically to have a slideshow at the top of each category layout page showing the latest from that category.
User avatar
Expert Boarder

GK User
Fri Feb 06, 2015 2:18 pm
You can use News Show Pro and widget rules to specify on which category should be displayed, then you can add another NSP which will be visible on the next category and so on. Unfortunately I don't see other possibilities.
User avatar
Moderator

GK User
Fri Feb 06, 2015 3:55 pm
That is what I was looking for. A good deal of setup yes but its great to have the flexibility here so this is great, super support. Thank you
User avatar
Expert Boarder

GK User
Fri Feb 06, 2015 5:34 pm
So not all perfect here, the widget rules do not seem to play nicely. I have the news show pro setup on the category page here at the top and it works fine: http://www.jamjosandbox.com/magazine/category/politics/ the widget rule is to show only on the category however if you click any of the posts on that category page like this one: http://www.jamjosandbox.com/magazine/da ... australia/ you can see its only showing the news show pro widget on the single post page also which of course I do not want here. Any ideas on this as I do have the widget rules set correctly I believe. Thanks
User avatar
Expert Boarder

GK User
Fri Feb 06, 2015 8:28 pm
HI,

Category widget rules display widgets on the category and posts inside this category. If you want to change it, please edit gk_condition function in News/gavern/helpers/helpers.layout.php and change this line:
Code: Select all
$output .= ' (is_category(\'' . substr($input[$i], 9) . '\') || (in_category(\'' . substr($input[$i], 9) . '\') && is_single())) ';

to

Code: Select all
$output .= ' (is_category(\'' . substr($input[$i], 9) . '\') ) ';
User avatar
Moderator

GK User
Sun Feb 08, 2015 11:01 pm
Thanks for this. I will give this a try. I see in the Widget rules that there is an option to display on a "category" and also "category and descendants", I was wondering what does the one with Category and Descendants means? I assumed this one was category and all posts in that category but when I try it out I am not sure.

Thanks again.
User avatar
Expert Boarder

GK User
Mon Feb 09, 2015 12:38 am
Category with descendants is a category with all subcategories.
User avatar
Moderator

GK User
Mon Feb 09, 2015 1:41 pm
Thanks @Piotr

I have implemented your edit here and yes it removed the widget from showing on the posts of that category but also my sidebar is gone now as a result so therefore the single posts associated with a category dont have a sidebar either so this logic in total is not ideal.

What I really need is for the Widget rules to place widgets on a category and/or the single posts of a category. Is this possible somehow? I know woosidebars use this logic and it is very useful as it avoids the issues I am having here.

As you can see here now my posts are full width and I would like the sidebar to remain here: http://www.jamjosandbox.com/magazine/da ... australia/
User avatar
Expert Boarder

GK User
Tue Feb 10, 2015 9:14 am
Hi,

but on this page:
http://www.jamjosandbox.com/magazine/da ... australia/
you don't have any widgets in the sidebar, please remember that you can use more than one wiget rules, so you can also display widgets on all singe posts pages.
User avatar
Moderator

GK User
Tue Feb 10, 2015 1:48 pm
@Piotr I think you might have me confused now here but I do take your point.
I did try and add in a few more rules but obviously I cannot be applying sidebars to specific post ID's as this would be very time consuming as my site will have hundreds of posts per category. I tried the Post Type option also but this does not do anything either. Which rule do I use to display on all single posts of a category?

I know I can display a widget to display on all pages except, but then each time I ad a new page I need to go and set this which is not ideal. I guess I am trying to find the most logical path there. Thanks
User avatar
Expert Boarder

GK User
Tue Feb 10, 2015 4:44 pm
allmyhoney wrote:Which rule do I use to display on all single posts of a category?

On all posts from category, but not on this category page, right? I think you should install simple plugin called "widget logic" and then you can use any of the wordpress conditional tags:
http://codex.wordpress.org/Conditional_Tags

In you case you should use
Code: Select all
in_category('your_category_slug_or_ID')
to display widget on all posts of this category.
User avatar
Moderator


cron