[Resolved] Selectively show widgets on pages?

Home Forums Support [Resolved] Selectively show widgets on pages?

Home Forums Support Selectively show widgets on pages?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #113829
    _blank

    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?

    #113873
    Tom
    Lead Developer
    Lead Developer

    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;
    
     }
    #113993
    _blank

    TY!!!

    #114015
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! 🙂

    #174642
    Joachim

    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?

    #174718
    Tom
    Lead Developer
    Lead Developer
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.