Group Admins

WordPress Troubleshooting and Support

Public Group active 10 months, 1 week ago ago

WordPress support from our community

adding 4th footer widget to Twenty Eleven theme

Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #1215
    Jay
    Participant

    any idea how i would go about this? i did a google search on the topic but found nada.

    please advise. thanks in advance!

    #1969
    Steve
    Keymaster

    1) open up functions.php in twentyeleven.
    2) scroll down to line 420 and add the following code after it:

    register_sidebar( array(
    '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.

    Steve

    #1970
    Steve
    Keymaster

    Looks like the following should be added after line 466:

    if ( is_active_sidebar( 'sidebar-6' ) )
    $count++;

    #1971
    Steve
    Keymaster

    Here’s the full functions.php file. This is untested.
    http://pastebin.com/gSybMStT

    #1972
    Steve
    Keymaster

    Of course, I forgot the most important thing. You will need to update the:sidebar-footer.php file.

    #1973
    Jay
    Participant

    thanks so much steve. excellent support!!!

    #1974
    Jay
    Participant

    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.

    #1975
    Margarete Koenen
    Participant

    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.

    #1976
    Steve
    Keymaster

    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.

    #1977
    Jay
    Participant

    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.

    #1978
    Steve
    Keymaster

    you will need opening and closing php tags.

    #1979
    Jay
    Participant

    got it. thank you!

    #1980
    Jeremy Iglehart
    Participant

    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.

    #1981
    Jeremy Iglehart
    Participant

    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:
    http://pastebin.com/PCcAjJZF

    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.

Viewing 14 posts - 1 through 14 (of 14 total)
  • You must be logged in to reply to this topic.