Community Forums › Forums › Archived Forums › Design Tips and Tricks › Remove Widget Areas from Outreach Pro
Tagged: remove widget areas
- This topic has 6 replies, 3 voices, and was last updated 8 years, 8 months ago by
msummers.
-
AuthorPosts
-
May 25, 2016 at 7:37 am #186251
msummers
MemberI am using only the Footer 1 widget area on my site and would like to remove the Footer 2 - Footer 4 widget areas from the administrative display. In addition I'd like to edit the description and name for the remaining Footer 1 area (it's being used for a Call to Action). What is the best way to do those things?
Thanks!
May 25, 2016 at 8:20 am #186256Brad Dalton
ParticipantRemove the code which registers the widgets from your functions file.
You can change the name and description in the code which registers the widget in your functions file. Just don't change the value for the I.D.
May 25, 2016 at 8:44 am #186260msummers
MemberThanks, Brad! But the code for these widget areas (footer1-5) is not in my functions file. I can see the loop that adds them in the parent functions file, but I'm not clear on how to just remove 2-4 and leave footer1 in place. I suppose there is an unregister_sidebar() command that I can use, but can you help with the use of that?
May 25, 2016 at 10:11 am #186265msummers
MemberGot it! I added this to my child-theme's functions.php:
add_theme_support( 'genesis-footer-widgets',1);
and the other 3 widget areas disappeared. Now how can I change that widget area's description and title?
May 27, 2016 at 7:21 am #186376msummers
MemberLet me clarify my question:
In the Genesis lib folder there is a file called widgetize.php where the 'genesis-specific' widget areas are created. This is where the code is that forms those (potentially) 4 footer widget areas. The code is -
function genesis_register_footer_widget_areas() { $footer_widgets = get_theme_support( 'genesis-footer-widgets' ); if ( ! $footer_widgets || ! isset( $footer_widgets[0] ) || ! is_numeric( $footer_widgets[0] ) ) return; $footer_widgets = (int) $footer_widgets[0]; $counter = 1; while ( $counter <= $footer_widgets ) { genesis_register_widget_area( array( 'id' => sprintf( 'footer-%d', $counter ), 'name' => sprintf( __( 'Footer %d', 'genesis' ), $counter ), 'description' => sprintf( __( 'Footer %d widget area.', 'genesis' ), $counter ), '_genesis_builtin' => true, ) ); $counter++; } }
I can limit that code to a single widget area by using the previously mentioned 'add_theme_support()' function so that the widget area will only support a single widget. What I would like to do now is to change this code -
'name' => sprintf( __( 'Footer %d', 'genesis' ), $counter ), 'description' => sprintf( __( 'Footer %d widget area.', 'genesis' ), $counter ),
to a custom name and description. It seems like I'd need to unregister that widget area and then redefine it in Outreach Pro's functions.php file, but how to I do that? Neither 'unregister_widget_area' nor 'unregister_sidebar' seem to work.
Thanks for any further help!
June 1, 2016 at 1:43 am #186665Christoph
MemberHi,
As far as I can see, you would have to remove the theme support for the footer widgets and register and output a new widget area with your desired name and description.
http://my.studiopress.com/tutorials/register-widget-area/I wouldn't think it´s worth the hassle.
June 3, 2016 at 9:33 am #186865msummers
MemberThanks, Christoph. From my perspective, it's definitely worth the hassle! I am eager to learn how to do these things, you see... 🙂
Anyhow, I do know how to register a widget area already - that's not my problem. What I need to know is what should I do to UNREGISTER the widget area (from a child theme) when that widget area is defined in the parent Genesis lib folder in a file called widgetize.php. Can I just add a 'lib' folder to my child theme and add modifications to a newly created 'widgetize.php' file in that child's new lib folder? And would I need to UNREGISTER the original widget area first? If so, can you tell me how to do that, please?
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.