Community Forums › Forums › Archived Forums › General Discussion › Widget on Blogroll Page Only
- This topic has 5 replies, 3 voices, and was last updated 9 years, 10 months ago by Summer.
-
AuthorPosts
-
June 3, 2014 at 12:30 am #107914mborgerMember
Hello. Is there a way to put a text widget on a category blogroll page only but not on the posts themselves? I'm looking to add a text widget to: http://bigrockinvestments.com/category/hawaiirealestatenews/ but on that page only. I'm using the "Display Widgets" plugin to moderate this elsewhere throughout the site but I can't make it work for this problem, partially because I don't think it has a specific page ID, at least none that I can find. But perhaps there's a way outside of this plugin - I'm open to anything.
http://bigrockinvestments.com/category/hawaiirealestatenews/June 3, 2014 at 2:50 am #107919Brad DaltonParticipantYou can hook in a widget using the is_page_template() conditional tag
Add that after the function using this code http://my.studiopress.com/tutorials/register-widget-area/
June 3, 2014 at 1:18 pm #107993mborgerMemberThanks Brad. So you're saying I need to create (and register) a new widget for this purpose?
And what would go in the 'is page' tag? I only want this blogroll page to feature the widget, not every post that's in the category (or uses the template)? That's the only URL that I want to show the widget.
June 3, 2014 at 3:54 pm #108006SummerMemberYou can drag a normal text widget to your regular sidebar, and make it conditionally appear on only the pages you want.
Some people like to use the Widget Login plugin, but personally I prefer Dynamic Widgets.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkJune 3, 2014 at 4:41 pm #108012mborgerMemberI don't know how to do that natively -- I hit my ceiling pretty quickly with the code.
However, I do use the Display Widgets plugin to conditionally control this elsewhere, just as I assume the widgets you mention do. This plugin gives you the option to get really granular and define a condition (show or hide) at the individual page/post level *IF* you have the page/post ID. I can't seem to find the page ID for that specific page -- I don't think it has one. I think it's a dynamically created page that doesn't otherwise exist until called upon. I can't find it in the admin module where I'd normally find the ID by looking at the bottom status bar.
June 3, 2014 at 7:08 pm #108023SummerMemberDo what natively? You lost me there... there's no coding involved in the options I provided.
With Widget Logic plugin, you would drag a widget to your sidebar in the admin area, and add the PHP conditional, similar to what Brad provided. With the Dynamic Widgets plugin, you would drag a widget to your sidebar in the admin area, and click to select which pages/posts/cpt's/archives you'd want that widget to appear in.
Both plugins give you the granularity you're talking about, without handcuffing you to post IDs. Zero coding necessary.
Since the blog page is typically an archive page, a listing of the posts you've made, it won't have a page or post ID ever, in that you are correct (unless you create one using an Archive template in which case it will have a page ID).
It sounds like you're using the built in archives, and because of this, your hands are tied by the limitations in the plugin you've chosen to use.
Your best option would be to switch plugins, one that doesn't limit you to pages or posts, and either of the ones I described would do that for you.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After Dark -
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.