Forums

[resolved] Active sidebar without knowing theme? (12 posts)

  1. kirstymoore
    Member
    Posted 1 year ago #

    Hi
    I have no idea what theme my site was built on:http://www.drummondclinic.co.uk/
    It has been hacked about a lot since it's original format.
    I think is was originally supposed to support a sidebar, at least, it has a sidebar.php. I'm not convinced that what's in the file is the original file though.
    Anyway, I would like to activate a sidebar now and am not sure how to go about it.
    Can anyone offer any advice?
    Thanks
    K

  2. richarduk
    Member
    Posted 1 year ago #

    If you've got a sidebar.php it'll probably contain a div with bits of code in it.

    Your theme files e.g. index.php may contain something like this:

    <?php include("sidebar.php")?>

    This might have been commented out.

    if not, wherever you want your sidebar to appear, insert the code above and see what happens. I have no idea how competent you are (not being rude :-) ) so if you're new to this and it looks broken, try inserting the code somewhere else on the page.

    Without any other information to go on that's the best I can suggest.

  3. Rev. Voodoo
    Volunteer Moderator
    Posted 1 year ago #

    <?php get_sidebar(); ?>

    may also be how the sidebar is called.....

  4. kirstymoore
    Member
    Posted 1 year ago #

    Thanks for helping out guys.
    I'm competent, just not at php :o) My html is quite good but I'm new to WP and php. I'm learning fast though! I really appreciate your input.
    I've searched my index.php and there is no reference to sidebar in there.
    I'd copy my sidebar.php in but it's pretty long, given it's not doing anything. It looks to me like someone maybe put an archive of posts in it once. There's only the one div in it and that's the opening one:

    <div id="sidebar">

      <?php /* Widgetized sidebar, if you have the plugin installed. */
      if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>

    • <?php include (TEMPLATEPATH . '/searchform.php'); ?>
    • <!-- Author information is disabled per default. Uncomment and fill in your details if you want to use it.

  5. kirstymoore
    Member
    Posted 1 year ago #

    OK. Now I'm getting somewhere. I posted the

    <?php include("sidebar.php")?> into one of my templates and it looks like yes, it has retrieved a load of old posts. A bit messy and a bit hard to tell where the sidebar starts and ends, but I think I can probably work from it.

    I have quite a lot of page templates. Do I need to put the include text into all of them, or should I try and tackle getting it into index.php or somewhere similar?
    K

  6. richarduk
    Member
    Posted 1 year ago #

    Get it into index.php or whatever first. When it's all sorted out, post it into any templates that you want e.g. categories.php, single.php etc.

    View the source code once you've uploaded the page and see what errors there are. Paste it into the WW3 HTML validator (search for it online). If you've only got a starting div you might need to put a closing div in.

  7. kirstymoore
    Member
    Posted 1 year ago #

    Thanks Richard. This may take a while but I'll check back in soon with my progress :o)
    K

  8. kirstymoore
    Member
    Posted 1 year ago #

    WIP: Putting
    <?php get_sidebar(); ?>
    into index.php certainly introduces a sidebar of sorts to my home page. I haven't been able to 'manage' it though and it reformats the page to pull the normal contents over into the sidebar. I'm guessing that means I'll need some changes to my css files (cannot find anything on sidebars in there).
    In trawling the codex I see reference to
    wp-includes/widgets.php
    which does not exist in my system.
    Also if I go to the widgets manager from the dashboard, it says I have no sidebars defined.

  9. kirstymoore
    Member
    Posted 1 year ago #

    My theme functions.php does include:

    <?php
    if ( function_exists(’register_sidebar’) )
    register_sidebar();
    ?>

  10. kirstymoore
    Member
    Posted 1 year ago #

    Soory - school boy error - I do have widgets.php

  11. kirstymoore
    Member
    Posted 1 year ago #

    OK. Thanks to SusieN I am now officially wigitised!
    http://wordpress.org/support/topic/no-sidebars-defined-1?replies=9
    Getting very excited now.
    K

  12. kirstymoore
    Member
    Posted 1 year ago #

    And...success...
    http://www.drummondclinic.co.uk/
    Thanks for all the help.
    K

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.