WordPress.org

Ready to get started?Download WordPress

Forums

Help needed adding a sidebar to the pages! (8 posts)

  1. carra23
    Member
    Posted 1 year ago #

    Hey guys,

    I'm looking to insert a sidebar that sits on the right of my pages but I'm having some trouble with it.

    I Googled a tutorial and found this;
    http://www.tastyplacement.com/add-sidebar-wordpress

    I got through the first two steps fine but the third rather confused me a little.

    I've uploaded the homepage-sidebar.php file to where all the other .php files sit for the template but I have no idea where I'm meant to be inserting the code below?

    <?php get_sidebar('homepage'); ?>

    Can anyone help me out here?

    Or is there an easier way to do what I'm trying to accomplish??

    Thanks guys.

  2. viky081
    Member
    Posted 1 year ago #

    Rename that homepage-sidebar.php into sidebar-homepage.php and after use this code
    <?php get_sidebar('homepage');?>

    hope its may work

  3. carra23
    Member
    Posted 1 year ago #

    Hey Viky,

    Thanks for your response.

    Although I think you may have slightly misinterpreted what I'm trying to say.

    I don't know where I'm meant to insert that code!

  4. alchymyth
    Forum Moderator
    Posted 1 year ago #

    insert a sidebar that sits on the right of my pages

    the most likely template to insert the code is page.php, however the details depend on your currently used theme.

  5. carra23
    Member
    Posted 1 year ago #

    I'm using the TwentyEleven theme.

  6. carra23
    Member
    Posted 1 year ago #

    Just tried adding the code to the page.php but it put the sidebar below the content, rather than on the right side of the content.

  7. alchymyth
    Forum Moderator
    Posted 1 year ago #

    before you make any customisations to the templates, strongly consider to create a child theme to work with - http://codex.wordpress.org/Child_Themes - it is not recommended to edit the default theme Twenty Eleven directly.
    one of the reason being, that any customisations will get overwritten when you upgrade the theme.

    a:
    Twenty Eleven comes with a page template with sidebar 'Sidebar Template';

    b:
    any new page template with a sidebar needs to have some body_classes corrected so the sidebar displays in the right location; I have written about this in my site: http://www.transformationpowertools.com/wordpress/twenty-eleven-new-page-template-with-sidebar-correction

    c:
    a link to your site might help with troubleshooting

  8. carra23
    Member
    Posted 1 year ago #

    Hey Alchymyth,

    Thanks for your response.

    I have a Custom CSS plugin for the site which I presume acts as a child theme?

    Here is a link to the site I'm working on;

    http://www.tyisafbala.co.uk/wordpress

    What do you advise me to do here then?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.