• quinker

    (@quinker)


    Hi,
    I am using the theme https://www.ezwpthemes.com/templates/commute-reader.html for my blog.

    I have a problem. I am able to drag and drop widgets into the sidebar in Appearance ->Widgets. But the widgets are not appearing on the page on the sidebar.

    All items displayed in the sidebar are coming from code in sidebar.php. I’ve updated my WP version to 2.9.2

    Can someone please help me resolve this?

    Thanks,

Viewing 3 replies - 1 through 3 (of 3 total)
  • Michael

    (@alchymyth)

    your theme does not have widget support in sidebar.php; read this article from the codex to make it dynamic:
    https://codex.www.ads-software.com/Function_Reference/dynamic_sidebar

    already inserted into the sidebar.php code below:

    <div id="sidebar">
    
    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    
    <h3>RECENT POSTS</h3>
    <ul>
    <?php get_archives('postbypost', 10); ?>
    </ul>
    <div id="sidebar_left">
    <h3>Search</h3>
    <?php get_sidebar_search_form(); ?>
    <h3>Categories</h3>
    <ul>
    <?php wp_list_cats('sort_column=name&optioncount=0&hierarchical=0'); ?>
    </ul>
    <h3>Archives</h3>
    <ul>
    <?php wp_get_archives('type=monthly'); ?>
    </ul>
    <h3>Meta</h3>
    <ul>
    <?php wp_register(); ?>
    <li><?php wp_loginout(); ?></li>
    <li><a href="https://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional">Valid <abbr title="eXtensible HyperText Markup Language">XHTML</abbr></a></li>
    <li><a href="https://gmpg.org/xfn/"><abbr title="XHTML Friends Network">XFN</abbr></a></li>
    <li><a href="https://www.ads-software.com/" title="</li>
    <?php wp_meta(); ?>
    </ul>
    </div>
    <div id="as"><img src="<?php bloginfo('stylesheet_directory'); ?>/images/img3.jpg" /></div>
    
    <?php endif; ?>
    
    </div>
    Thread Starter quinker

    (@quinker)

    Thankyou for the reply. Is this what I need to do for a dynamic sidebar?

    <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar() ) : ?>

    Add the above code to sidebar.php ???

    Where is this function defined? I cannot find widgets.php in wp-includes. Where can I find this file to upload?

    Could you please tell me step by step about what exactly I need to do?

    I am a newbie and am new to coding too.

    Please help!

    Thread Starter quinker

    (@quinker)

    Oh yes, I got it..

    Its working now.. Thanks a ton alchymyth ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Widgets not working’ is closed to new replies.