WordPress.org

Ready to get started?Download WordPress

Forums

Alternate between left and right sidebar in twenty eleven (6 posts)

  1. Starcus
    Member
    Posted 1 year ago #

    Hi there all of you!

    I am quite new to wordpress but have basic knowledge in html, php and some programming languages.

    I am currently working on a child theme to twenty eleven where I would like to create two custom page templates to have the option of putting the sidebar either on the right side or the left side of the page.

    There is a built in feature in twenty eleven where you can set the default sidebar location as either right or left. The problem is that I would like to have the sidebar to the right side onsome pages and to the left on others.

    I suppose that creating two custom page templates is the easiest way of doing this? I have no idea on where to begin though! Is there anyone having a smart fix for this out there so please share it!

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    here is an idea to create new page templates to be able to set the sidebar orientation for static pages in a child theme of Twenty Eleven.

  3. Starcus
    Member
    Posted 1 year ago #

    Thank you for the suggestion but I have actually already tried that guide and somehow it crashes my page after I upload the new functions.php. I cannot even access the admin panel when this happens and I have to access the database via php myadmin and reset the theme to standard twentyeleven. Maybe there is a fix to the crash problem though, I will try to upload the error code.

  4. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    if you have a totally new functions.php in your child theme, you need to start that file with <?php in the first line.

    feel free to paste the full code of functions.php into a http://pastebin.com/ and post the link to it here.

  5. Starcus
    Member
    Posted 1 year ago #

    Ah I see, im quite sure that must be the problem! Beacuse I tried to simply upload an altered functions.php file to my child theme folder where I had copied the code of the original functions.php and then added your code (saw now that you were the author of that guide?).

    But from what I just read when doing some research this will make the webpage try to load both the functions.php in the parent theme folder and the functions.php in the child theme folder which causes the crash?

    I will try your suggestion as soon as I get home!

  6. Starcus
    Member
    Posted 1 year ago #

    Problem fixed! It was a misunderstanding from my part about how to use a new functions.php in the child theme folder that led to the crash. You should always start out with a blank functions.php in the child theme folder, not copy the functions.php file from the parent theme folder.

Topic Closed

This topic has been closed to new replies.

About this Topic