WordPress support from our community
adding 4th footer widget to Twenty Eleven theme
July 22, 2011 at 11:48 pm #1215
any idea how i would go about this? i did a google search on the topic but found nada.
please advise. thanks in advance!July 23, 2011 at 12:06 am #1969
1) open up functions.php in twentyeleven.
2) scroll down to line 420 and add the following code after it:
'name' => __( 'Footer Area Four', 'twentyeleven' ),
'id' => 'sidebar-6',
'description' => __( 'An optional widget area for your site footer', 'twentyeleven' ),
'before_widget' => '
'before_title' => '
'after_title' => '
3) That will add the footer.
4) Now you will need to make changes to style.css to fix the widths.
SteveJuly 23, 2011 at 12:10 am #1970
Looks like the following should be added after line 466:
if ( is_active_sidebar( 'sidebar-6' ) )
July 23, 2011 at 12:12 am #1971July 23, 2011 at 2:39 am #1972
Of course, I forgot the most important thing. You will need to update the:sidebar-footer.php file.July 23, 2011 at 12:06 pm #1973
thanks so much steve. excellent support!!!July 26, 2011 at 12:25 am #1974
got a followup question. i’m using a child theme. I know I need to override the parent functions.php with my own child functions.php.
but i have no idea how to setup the child functions.php file and break out these two different items and have them override the parent functions.php stuff.
any idea how to do that? thanks in advance.July 26, 2011 at 12:43 am #1975Margarete KoenenParticipant
In general, all you have to do is create a new functions.php file in your child theme and start putting in your code. I have not followed this conversation closely, so I don’t know the details of what you are doing, but give it a try.July 26, 2011 at 1:33 am #1976
As Margarete mentioned, copy all the functions.php code that I mentioned above into your child themes functions.php.
Then copy sidebar-footer.php to your child theme and make the neccessary changes there as well.
WP will load BOTH functions.php and only your child theme’s sidebar-footer.php.July 26, 2011 at 1:59 am #1977
i made the changes to the child’s sidebar-footer.php.
regarding the child’s functions.php, i don’t have to put any php tags around it? i just slap in the code you listed in the child theme’s functions.php, and those 10 lines of code are all that’s in there?
thanks for bearing with me here.July 26, 2011 at 2:06 am #1978
you will need opening and closing php tags.July 26, 2011 at 2:25 am #1979
got it. thank you!December 28, 2011 at 9:24 pm #1980Jeremy IglehartParticipant
Take a look at line #482 on your http://pastebin.com/gSybMStT – Don’t forget to add a case here so that when you have one, two, three or four columns it will properly apply the class to the #supplementary div tag (This will help you style based on how many footer area’s you create, and still allow it to be dynamic)
P.S. I am going to try and get this working for my own projects (I don’t like just three columns, if you’re working with a grid system 3 columns is a weird number… even numbers work better >:P )
If I do get this working I will post a link to the code here, if not – than I’ll also update this page.December 29, 2011 at 12:15 am #1981Jeremy IglehartParticipant
Okay, so to do this what I think is “right” your function.php should have this code in it: http://pastebin.com/EMUrM9nz
(The coolest part of this whole file is the add_action call – priority 11 is needed so that they show up in the right order in your WP dashboard.
And for your sidebar-footer.php file:
The Theme I am currently developing is called Sonya – hence the function name… name it whatever you want though – or leave it, it will still work and no one will ever know 😉
I will be writing up a full blog about how to do this and explain each function – but I thought I would just give you guys the quick and dirty version now.
- You must be logged in to reply to this topic.