Site logo

Archived topic

Selectively show widgets on pages?

5 replies · Started by _blank on June 10, 2015

Viewing posts 1–6 of 6

I'd like my footer widgets to appear on the home page only.

Searching this forum I found a similar question here

So I tried it with several plugins; Jetpak's Widget Visibility, Widget Logic and Display Widgets.

For me, they did hide the widget content on the unselected pages, but they replaced it with the generic widget notice…
"
Footer Widget 2

Replace this widget content by going to Appearance / Widgets and dragging widgets into Footer Area 2.

To remove or choose the number of footer widgets, go to Appearance / Customize / Layout / Footer Widgets.
"

Is there something else I need to do to accomplish this?

Is your homepage your blog or a static page?

If it's a static page, you can disable footer widgets globally in the Customizer, and then choose to display however many you want while editing the page itself: generatepress.com/knowledgebase/choosing-footer-widgets/#individual

If it's your blog, you can enable the widgets using a function:

add_filter( 'generate_footer_widgets','generate_custom_footer_widgets' );
function generate_custom_footer_widgets()
{

 	// If we are on the blog homepage, set the widgets
 	if ( is_home() )
 	 	return '2';

 	// Or else, use the default widget setting
 	return $widgets;

 }

TY!!!

You're welcome! :)

for me it doesn't work. when saving my selection it alway jumps back to "Global Footer Widget Settings". Or do I have to use the Premium Version for this?

This archived topic is closed to new replies.