• I am using the AutoFocus theme. It seems to be designed to not have a sidebar/widgets. However the sidebar.php file is present. What can be done to enable it? I’m not very experienced at this stuff. Here is the sidebar code:

    <div id=”primary” class=”sidebar”>
    <ul class=”xoxo”>
    <?php if (!function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(1) ) : // begin primary sidebar widgets ?>

    <li id=”pages” class=”widget”>
    <h3><?php _e(‘Pages’, ‘sandbox’) ?></h3>

      <?php wp_list_pages(‘title_li=&sort_column=post_title&depth=1’ ) ?>

    <li id=”search”>
    <h3><label for=”s”><?php _e(‘Search’, ‘sandbox’) ?></label></h3>
    <form id=”searchform” method=”get” action=”<?php bloginfo(‘home’) ?>”>
    <div>
    <input id=”s” name=”s” type=”text” value=”<?php echo wp_specialchars(stripslashes($_GET[‘s’]), true) ?>” size=”10″ tabindex=”1″ />
    <input id=”searchsubmit” name=”searchsubmit” type=”submit” value=”<?php _e(‘Find’, ‘sandbox’) ?>” tabindex=”2″ />
    </div>
    </form>

    <li id=”categories” class=”widget”>
    <h3><?php _e(‘Categories’, ‘sandbox’); ?></h3>

      <?php wp_list_categories(‘title_li=&hierarchical=1&use_desc_for_title=1’) ?>

    <li id=”archives” class=”widget”>
    <h3><?php _e(‘Archives’, ‘sandbox’) ?></h3>

      <?php wp_get_archives(‘type=monthly’) ?>

    <?php endif; // end primary sidebar widgets ?>

    </div><!– #primary .sidebar –>

    <div id=”secondary” class=”sidebar”>

    <ul class=”xoxo”>
    <?php if (!function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(2) ) : // begin secondary sidebar widgets ?>

    <li id=”rss-links” class=”widget”>
    <h3><?php _e(‘Subscribe’, ‘sandbox’) ?></h3>

    <li id=”meta” class=”widget”>
    <h3><?php _e(‘Meta’, ‘sandbox’) ?></h3>

      <?php wp_register() ?>

    • <?php wp_loginout() ?>
    • <?php wp_meta() ?>

    <?php endif; // end secondary sidebar widgets ?>

    </div><!– #secondary .sidebar –>

    Thank you!!

Viewing 13 replies - 1 through 13 (of 13 total)
  • Do you have widgets enabled in your functions.php file? πŸ™‚

    Thread Starter dahrens

    (@dahrens)

    How do I know if I have widgets enabled?

    Sorry for being slow in getting back to you; I thought I had posted, but when I checked it later, I realized I hadn’t.

    Look in your functions.php template and look for this:

    <?php
    if ( function_exists('register_sidebar') ){
    register_sidebar();
    }
    ?>

    Also, if you look under Themes and deactivate and reactivate your theme, WP will give you a notice (usually) if your theme is or isn’t widget-enabled.

    I am using the same theme and trying to turn on the sidebar. Here is the code in functions.php:

    <?php
    }

    // Widgets plugin: intializes the plugin after the widgets above have passed snuff
    function sandbox_widgets_init() {
    if ( !function_exists(‘register_sidebars’) )
    return;

    // Uses H3-level headings with all widgets to match Sandbox style
    $p = array(
    ‘before_title’ => “<h3 class=’widgettitle’>”,
    ‘after_title’ => “</h3>\n”,
    );

    // Table for how many? Two? This way, please.
    register_sidebars(2, $p);

    // Finished intializing Widgets plugin, now let’s load the Sandbox default widgets
    register_sidebar_widget(__(‘Search’, ‘sandbox’), ‘widget_sandbox_search’, null, ‘search’);
    unregister_widget_control(‘search’);
    register_sidebar_widget(__(‘Meta’, ‘sandbox’), ‘widget_sandbox_meta’, null, ‘meta’);
    unregister_widget_control(‘meta’);
    register_sidebar_widget(array(__(‘RSS Links’, ‘sandbox’), ‘widgets’), ‘widget_sandbox_rsslinks’);
    register_widget_control(array(__(‘RSS Links’, ‘sandbox’), ‘widgets’), ‘widget_sandbox_rsslinks_control’, 300, 90);
    }

    // Translate, if applicable
    load_theme_textdomain(‘sandbox’);

    // Runs our code at the end to check that everything needed has loaded
    add_action(‘init’, ‘sandbox_widgets_init’);

    // Adds filters so that things run smoothly
    add_filter(‘archive_meta’, ‘wptexturize’);
    add_filter(‘archive_meta’, ‘convert_smilies’);
    add_filter(‘archive_meta’, ‘convert_chars’);
    add_filter(‘archive_meta’, ‘wpautop’);

    // Remember: the Sandbox is for play.
    ?>

    j-aperture

    (@maestro_illuminist)

    You’re having similar problem that came up in another thread:

    http://wordpress.org/support/topic/283760?replies=8

    You can find solution there.

    << Website: http://maestroilluminist.com >>

    I did see that in the theme documentation, and tried it. It could be that I’m misunderstanding something, but following those steps only implements the sidebars on pages created using the Archives Page template. I would like to have the side bars displayed next to each post.

    j-aperture

    (@maestro_illuminist)

    I don’t think you’re misunderstanding anything but it’s just how autofocus is set up to do by default. If you want to have sidebar showing on every page, you’d need to add <?php get_sidebar() ?> to single.php. You’ll need to play around with its placement though.

    << Website: http://maestroilluminist.com >>

    Beautiful! That’s exactly what I was looking for. Thank you very much.

    Is it also possible to let the sidebar being displayed on the homepage?

    j-aperture

    (@maestro_illuminist)

    You can use the same trick on home.php for sidebar to show up on your homepage.

    << Website: http://maestroilluminist.com >>

    Hmm .. I still can get it to work.

    Could anyone reply where to place <?php get_sidebar() ?> exacactly, to get it like any classic sidebar to the right side of the blog?

    It appears anywhere, just not on this position πŸ™

    The place to add the <?php get_sidebar() ?> is within the <div class=”entry-meta”> on the single.php you can replace the original sidebar content with the widget sidebar content if you remove the existing content within the div.

    Wills

    http://www.williiamwilsonphotography.co.uk

    feels like Chinese.
    Can anyone please post a step by step instruction how to turn on the sidebar?

    Thanks in advance…;)

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Sidebar seems to be disabled… How do I fix it?’ is closed to new replies.