Community Forums › Forums › Archived Forums › General Discussion › Genesis Simple Sidebars – custom sidebar for CATEGORY PAGE?
Tagged: simple sidebars
- This topic has 14 replies, 2 voices, and was last updated 8 years, 11 months ago by carasmo.
-
AuthorPosts
-
November 4, 2015 at 12:08 pm #170159inventyouMember
Is there a way to make a custom sidebar for a category page? It's easy to assign a post to a sidebar depending on its category, but I've got categories in my navigation that I'd like to have the same sidebar as the posts with custom sidebar.
I'm using Centric Pro theme. Thanks!!
http://community.beaudigital.com/November 5, 2015 at 7:26 am #170206inventyouMemberAnyone?
November 5, 2015 at 8:20 am #170214carasmoParticipantI use this: https://wordpress.org/plugins/display-widgets/
Put your widget where you want as normal. There will be additional fields at the bottom of the panel, toggle "Show on Checked Pages" uncheck "Front" and then scroll down to the category where it will appear, check it and save.
November 5, 2015 at 9:00 am #170219inventyouMemberI tried that, but no matter what I check the widget doesn't show up.
November 5, 2015 at 10:00 am #170224carasmoParticipantThe description for simple sidebars is that it puts the sidebar on the category archive page but not on the individual posts associated with the category. I am assuming that that's what you mean, you want the sidebar to appear on all posts associated with the category or you have pages that are your category pages and they are not archives?
Here's the link to the instructions for simple sidebars and its limitations.
In any case, since the Display Widget does give you the ability to assign widgets per page, post, category, but you are not able to do that, I would suspect that the SImple Sidebar is conflicting with it. I registered new sidebars globally in my functions.php and used Display Widget to not show or show depending on the situation.
Hopefully someone will come along to help.
November 5, 2015 at 10:10 am #170225inventyouMemberYeah, essentially I have pages like this in my actual navigation:
http://domain.com/category/news/and
http://domain.com/category/events/And currently they use the primary sidebar widget. I created new widgets with Genesis Simple Sidebars, and have tried to place them on these category pages that show all posts for those categories, and none of the plugins are working. So I suspect maybe you are right that there is a conflict with the plugin.
Bummer.
November 5, 2015 at 10:11 am #170226carasmoParticipantThere's a plugin called "Widget Logic". Here's a tutorial on using conditional logic to put your sidebar on a page and the category
Link:
http://bradsknutson.com/blog/add-different-sidebar-content-page-wordpress/Conditional Tags:
http://codex.wordpress.org/Conditional_TagsSo if you have the Widget Logic installed, to show a specific widget on all posts in a particular category, you would use the following logic you would adjust to your needs In the field the widget provides.
is_category( array( 9, 'blue-cheese', 'Stinky Cheeses' ) )
Returns true when the category of posts being displayed is either term_ID 9, or slug "blue-cheese", or name "Stinky Cheeses".
November 5, 2015 at 11:04 am #170232inventyouMemberTrying to figure out how to add a sidebar. I've found code for registering the new widget area, but can't seem to figure out how to hook it in to pages. It all seems pretty confusing to me.
November 5, 2015 at 11:46 am #170236carasmoParticipantThere's many tutorials in the wild for Genesis and registering a new sidebar and where to put it
genesis_before_sidebar_widget_area
(if primary sidebar).I recommend hiring someone if it looks like gibberish:
http://www.pixelfrau.com/genesis-theme-customization/
orThen once you see how it's done for you, you can use it again and again.
It would be overkill to register per category, your functions.php file or include would be very long and too much work to get this done.
The better thing would be to just register a new sidebar globally and use something else, like those other plugins, to show and hide on different pages.
November 5, 2015 at 11:54 am #170239carasmoParticipantWhat I don't understand is why you had to use Simple Sidebars in the first place. If your theme didn't have sidebars, you only need to look for its unregister in your functions.php file and comment it out.
unregister_sidebar( 'sidebar' );
Commented out
//unregister_sidebar( 'sidebar' );
Then go to the home page and the pages that don't use a sidebar, click the full width layout. Choose the content-sidebar layout on those pages you do. So globally go in to admin for Genesis, choose the the layout used the most then only on the pages where you use sidebars, those individual pages and posts you'd change. Makes less work.
Back up save etc., before messing with functions.php (I make a duplicate on my local disk for quick stuff and name it functions_bu_date-time.php). Use a decent code editor like Sublime Text (do not use a word processor of any kind to mess with code php/html/css).
November 5, 2015 at 11:59 am #170243inventyouMemberThanks so much for all your in depth help. Found this tutorial that seems a bit easier to understand than the others.
https://www.nutsandboltsmedia.com/how-to-add-a-widget-area-to-a-page-using-genesis/
November 5, 2015 at 12:52 pm #170250inventyouMemberIf you don't mind, one thing that tutorial doesn't address is adding multiple conditions for multiple widgets. Here is one it gives. If I add more than one of these for each new widget, it breaks my site.
//* Add the page widget in the content - HTML5
add_action( 'genesis_entry_footer', 'nabm_add_page_content' );
function nabm_add_page_content() {
if ( is_page('ID') )
genesis_widget_area ('pagewidget', array(
'before' => '<div class="pagewidget"><div class="wrap">',
'after' => '</div></div>',
) );
}November 5, 2015 at 1:06 pm #170253carasmoParticipantYou can't use the same one over and over again. I doubt a tutorial would go over such a specific need and for something you don't need to do. Simple register ONE sidebar widget area (this is an area to add many widgets) in the location (genesis_entry_footer) you want, load that widget up (drag in what you want to show there) then with the Display Widget or the other Conditional Logic widget show based on some sort of logic. So I have 20 pages, and each page has a widget I want in my entry footer area showing other stuff specific to that category, I load up my 20 widgets in that area and as I load them, while my plugin is turned on, I'll see a select menu (with the Display Widget plugin) to show on or hide on -- use show on and click the page, toggle off the home page and you're gold. Then, though you might have 20 widgets in the area you registered, you will show 1 when you get to that page, and another when you get to another page.
November 5, 2015 at 1:10 pm #170254inventyouMemberOk, my mind is a little fried. You are saying create ONE widget area. Use Display Widget to place any widget in that widget area in whatever category or page I want it on.
November 5, 2015 at 1:43 pm #170257carasmoParticipantOne widget area (register sidebar widget) can contain as many widgets as you want. You would just register it globally, without any page id or category etc., see:
http://my.studiopress.com/tutorials/register-widget-area/
Change the hook to where you want it to post.
Get your Display Widget plugin installed.
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.