Support » Fixing WordPress » New sidebar won’t load

  • Resolved Tracey Grady


    I have created a new sidebar but it doesn’t load into my page.

    On the template page I have the code

    <?php include(TEMPLATEPATH.”/sidebar2.php”);?>

    I can’t work out why it won’t load. Please help!

Viewing 7 replies - 1 through 7 (of 7 total)
  • do you get an error??

    No error – what happens is that the page loads, and where the sidebar SHOULD be, instead the only thing that comes up is the title of the site (and I can’t work out why that is, either)

    Well shouldn’t you have this to call a sidebar??

    <?php get_sidebar(); ?>

    The template page which calls up the sidebar has the code I mentioned above (I didn’t create the template page – it came with the theme). All I did was to change the file name from sidebar_page.php to sidebar2.php.

    Well then there is definately some code in between that is throwing you off. Simply a path..

    I’ve now tried

    <?php get_sidebar(); ?>

    which brings up a whole screen of error messages. When I change the code to

    <?php get_sidebar(‘about’); ?>

    (which reflects the name of the new sidebar file, sidebar-about.php) it goes back to a blank sidebar with just the title of the website showing in it – same problem as I began with.

    Ok now I’ve got it working. After searching through the WordPress Codex for the umpteenth time, I’m now using

    <?php include (‘sidebar-about.php’); ?>

    But it looks like the problem really lay within the code in my new sidebar file. I had inserted an image using

    <img src=”<?php bloginfo(‘template_url’); ?>/images/myimage.jpg” alt=”<?php bloginfo(‘name’); ?>” />

    which didn’t work. Interestingly, I tried to insert the image using straight html

    <img src=”images/myimage.jpg” />

    which didn’t work either, and neither did

    <img src=”images/myimage.jpg” width=”200″ height=”250″ />

    and the way I finally got it to work was to create a new <div> and insert the image as a background image, with width, height, margin and padding attributes all included.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘New sidebar won’t load’ is closed to new replies.