WordPress.org

Forums

Unable to put widgets in my side bar. (9 posts)

  1. mbenschop
    Member
    Posted 5 years ago #

    For some reason I cannot place widgets in my side bar. I follow all the instructions on the widget page. I drag from the available section to the right side area, enter the required information. Save this information. When I visit my site the widget is not in my side bar.
    My site is

  2. mbenschop
    Member
    Posted 5 years ago #

  3. flexnds
    Member
    Posted 5 years ago #

    You should have some code that looks like this in your sidebar.php file

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Page Sidebar') ) : ?>
        <?php endif; ?>

    If not you need to put it where you want the widget to show up in your sidebar.php

  4. mbenschop
    Member
    Posted 5 years ago #

    Please be patient with me. This is all new to me. Where would I find the sidebar php file?
    Thank you for your help

  5. flexnds
    Member
    Posted 5 years ago #

    In your admin panel open the Appearance box on your left navigation then click on editor. You will now see a list of files on your right hand side. You will find sidebar.php there. Drop that code in there. Without looking at the html I will not be able to tell you exactly where. You may have to try a couple different spots until you get the widgets to show up exactly where you want them to.

  6. mbenschop
    Member
    Posted 5 years ago #

    Sorry if I am taking up a lot of space, but I needed to show you the code

    <?php
    /**
    * Template Name: Single Right Sidebar
    *
    * @package Suffusion
    * @subpackage Templates
    */

    get_header();
    ?>

    <div id="main-col">
    <?php
    suffusion_page_navigation();
    suffusion_before_begin_content();
    ?>
    <div id="content">

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    <div class="post fix" id="post-<?php the_ID(); ?>">
    <?php suffusion_after_begin_post(); ?>

    <div class="entry fix">
    <?php suffusion_content(); ?>
    </div><!--/entry -->
    <?php suffusion_before_end_post(); ?>
    <?php comments_template(); ?>

    </div><!--/post -->

    <?php endwhile; endif; ?>
    </div></div>
    <?php get_footer(); ?>
    Not sure if I should copy the entire code. Incidentally my theme is by Suffusion. It is a good theme because you can do a lot of customization. I have only used one right sidebar. Maybe visiting my site will help

    Thank you for your patience.

  7. flexnds
    Member
    Posted 5 years ago #

    You have some big problems in your sidebar.. If you click on the links tab you it appears you have an attempted iframe that links to Amazon.com. Not sure if you put this here or what. You will not be able to put an Amazon iframe in the links section. If you are trying to use this as an affiate link The other link links to hostgator.

    I also downloaded the Suffusion template. I reviewed both sidebars code in the original template. Neither have the code you pasted above. Did you create that template. Also both of the original sidebars have the dynamic sidebar code. A sidebar template should never call for a header or footer in the code. For clarification are you dropping the widget into the correct sidebar. You have chosen to use only the right sidebar so you must drop the widget into the right sidebar under widgets. I will put both sidebar codes below.

    sidebar.php should look like this

    <?php
    /**
     * Default (first) sidebar
     *
     * @package Suffusion
     * @subpackage Templates
     */
    
    global $options;
    foreach ($options as $value) {
        if (get_option($value['id']) === FALSE) {
        	$$value['id'] = $value['std'];
        }
        else {
        	$$value['id'] = get_option( $value['id'] );
        }
    }
    if (is_page_template('1l-sidebar.php') || is_page_template('2l-sidebars.php') || is_page_template('1l1r-sidebar.php')) {
    	$sidebar_alignment = 'left';
    }
    else if (is_page_template('1r-sidebar.php') || is_page_template('2r-sidebars.php')) {
    	$sidebar_alignment = 'right';
    }
    else if ($suf_sidebar_alignment == 'left') {
    	$sidebar_alignment = 'left';
    }
    else if ($suf_sidebar_alignment == 'right') {
    	$sidebar_alignment = 'right';
    }
    ?>
    <div class="dbx-group <?php echo $sidebar_alignment;?> <?php echo $suf_wa_sb1_style;?>" id="sidebar">
    <?php
    if (!function_exists('dynamic_sidebar') || !dynamic_sidebar()) {
    	if ($suf_sidebar_1_def_widgets == 'show') {
    ?>
          <!--sidebox start -->
          <div id="categories" class="dbx-box suf-widget widget_categories">
            <div class="dbx-content">
            <h3 class="dbx-handle <?php echo $suf_sidebar_header;?>"><?php _e('Categories', 'suf_theme'); ?></h3>
              <ul>
                <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=1'); ?>
              </ul>
            </div>
          </div>
          <!--sidebox end -->
    
          <!--sidebox start -->
          <div id="archives" class="dbx-box suf-widget widget_archive">
            <div class="dbx-content">
            <h3 class="dbx-handle <?php echo $suf_sidebar_header;?>"><?php _e('Archives', 'suf_theme'); ?></h3>
              <ul>
                <?php wp_get_archives('type=monthly'); ?>
              </ul>
            </div>
          </div>
          <!--sidebox end -->
    
          <!--sidebox start -->
          <div id="links" class="dbx-box suf-widget">
            <div class="dbx-content">
            <h3 class="dbx-handle <?php echo $suf_sidebar_header;?>"><?php _e('Links', 'suf_theme'); ?></h3>
              <ul>
                <?php get_links('-1', '<li>', '</li>', '<br />', FALSE, 'id', FALSE, FALSE, -1, FALSE); ?>
              </ul>
            </div>
          </div>
          <!--sidebox end -->
    
          <!--sidebox start -->
          <div id="meta" class="dbx-box suf-widget">
            <div class="dbx-content">
            <h3 class="dbx-handle <?php echo $suf_sidebar_header;?>"><?php _e('Meta', 'suf_theme'); ?></h3>
              <ul>
    				<?php wp_register(); ?>
    				<li class="login"><?php wp_loginout(); ?></li>
    				<?php wp_meta(); ?>
    				<li><a href="http://validator.w3.org/check/referer" title="This page validates as XHTML 1.0 Transitional"><?php _e('Valid XHTML', 'suf_theme'); ?></a></li>
    					<li class="rss"><a href="<?php bloginfo('rss2_url'); ?>"><?php _e('Entries (RSS)', 'suf_theme'); ?></a></li>
                  <li class="rss"><a href="<?php bloginfo('comments_rss2_url'); ?>"><?php _e('Comments (RSS)', 'suf_theme'); ?></a></li>
                  <li class="wordpress"><a href="http://www.wordpress.org" title="Powered by WordPress">WordPress</a></li>
                  <li><a href="http://dryicons.com/" title="DryIcons">DryIcons</a></li>
              </ul>
            </div>
          </div>
          <!--sidebox end -->
    <?php
    	}
    }
    ?>
    </div><!--/sidebar -->

    sidebar-2.php should look like this

    <?php
    global $options;
    foreach ($options as $value) {
        if (get_option($value['id']) === FALSE) {
        	$$value['id'] = $value['std'];
        }
        else {
        	$$value['id'] = get_option( $value['id'] );
        }
    }
    
    if (is_page_template('1l-sidebar.php') || is_page_template('2l-sidebars.php')) {
    	$sidebar_alignment = 'left';
    }
    else if (is_page_template('1r-sidebar.php') || is_page_template('2r-sidebars.php') || is_page_template('1l1r-sidebar.php')) {
    	$sidebar_alignment = 'right';
    }
    else if ($suf_sidebar_2_alignment == 'left') {
    	$sidebar_alignment = 'left';
    }
    else if ($suf_sidebar_2_alignment == 'right') {
    	$sidebar_alignment = 'right';
    }
    ?>
    
    <div class="dbx-group <?php echo $sidebar_alignment;?>  <?php echo $suf_wa_sb2_style;?>" id="sidebar-2">
    
      <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar(2) ) : ?>
      <?php endif; ?>
    
    </div><!--/sidebar-2 -->

    As you can see both sidebars originally came with the dynamic sidebar funtion. So either you are dropping the widget in the wrong sidebar or you have edited the original code.

  8. flexnds
    Member
    Posted 5 years ago #

    My bad.. I missed the fact that this template has another 5 sidebar files. I will look into this further..

  9. mbenschop
    Member
    Posted 5 years ago #

    Thank you so much for your persistence in helping me. I am so lost. I am not knowledgeable with these codes. I surely appreciate all of your help

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags