WordPress.org

Ready to get started?Download WordPress

Forums

How to move a sidebar widget to footer? (10 posts)

  1. Reaven
    Member
    Posted 11 months ago #

    Hi,

    I'm trying to move the Meta widget from sidebar to footer. I'm using the Vortex theme. Here is the sidebar.php code:

    <div class="grid_5">
    <div id="sidebar">
    
    <?php
    if ( ! dynamic_sidebar( 'vortex-primary-sidebar' ) ):
    $vortex_theme_data = vortex_theme_data();
    ?>
    
    <div class="widget widget_search widget-widget_search">
    <div class="widget-wrap widget-inside">
    <?php get_search_form(); ?>
    </div>
    </div>
    
    <div class="widget widget_pages widget-widget_pages">
    <div class="widget-wrap widget-inside">
    <h3 class="widget-title"><?php _e( 'Pages', 'vortex' ); ?></h3>
    
    <?php wp_list_pages( 'title_li=' ); ?>
    </div>
    </div>
    
    <div class="widget widget_categories widget-widget_categories">
    <div class="widget-wrap widget-inside">
    <h3 class="widget-title"><?php _e( 'Categories', 'vortex' ); ?> </h3>
    
    <?php wp_list_categories('title_li='); ?>
    </div>
    </div>
    
    <div class="widget widget_archive widget-widget_archive">
    <div class="widget-wrap widget-inside">
    <h3 class="widget-title"><?php _e( 'Archives', 'vortex' ); ?></h3>
    
    <?php wp_get_archives( 'type=monthly' ); ?>
    </div>
    </div>
    
    <div class="widget widget_calendar widget-widget_calendar">
    <div class="widget-wrap widget-inside">
    <h3 class="widget-title"><?php _e( 'Calendar', 'vortex' ); ?></h3>
    <?php get_calendar(); ?>
    </div>
    </div>
    
    <div class="widget widget_recent_entries widget-widget_recent_entries">
    <div class="widget-wrap widget-inside">
    <h3 class="widget-title"><?php _e( 'Recent Posts', 'vortex' ); ?></h3>
    
    <?php wp_get_archives('type=postbypost&limit=5'); ?>
    </div>
    </div>
    
    <div class="widget widget_tag_cloud widget-widget_tag_cloud">
    <div class="widget-wrap widget-inside">
    <h3 class="widget-title"><?php _e( 'Tag Cloud', 'vortex' ); ?></h3>
    <?php wp_tag_cloud('smallest=10&largest=20&number=30&unit=px&format=flat&orderby=name'); ?>
    </div>
    </div>
    
    <div class="widget widget_text widget-widget_text">
    <div class="widget-wrap widget-inside">
    <h3 class="widget-title"><?php _e( 'About Vortex', 'vortex' ); ?></h3>
    <div class="textwidget"><?php printf( __( '%s', 'vortex' ), $vortex_theme_data['Description'] ); ?></div>
    </div>
    </div>
    
    <?php endif; ?>
    
    </div> <!-- end #sidebar -->
    </div> <!-- end .grid_5 -->

    I moved this piece from sidebar.php to footer.php without making any changes to it:

    <div class="widget widget_meta widget-widget_meta">
       <div class="widget-wrap widget-inside">
    
    <ul>
    	 <?php wp_register(); ?>
    
    <li><?php wp_loginout(); ?></li>
    <li><a>" title="<?php echo  esc_attr(__('Syndicate this site using RSS 2.0')); ?>"><?php _e('Entries <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
    <li><a>" title="<?php echo esc_attr(__('The latest comments to all posts in RSS')); ?>"><?php _e('Comments <abbr title="Really Simple Syndication">RSS</abbr>'); ?></a></li>
    	 <?php echo apply_filters( 'widget_meta_poweredby', sprintf( '
    <li><a href="%s" title="%s">%s</a></li>
    ', 				esc_url( __( 'http://wordpress.org/' ) ), 				esc_attr__( 'Powered by WordPress, state-of-the-art semantic personal publishing platform.' ),
    _x( 'WordPress.org', 'meta widget link text' )
    			) ); ?>
    			<?php wp_meta(); ?>
    			</ul>
          </div><!-- widget-wrap widget-inside -->
        </div><!-- widget widget_meta widget-widget_meta -->

    Yet the Meta widget still shows up at the sidebar section because it seems to be coded in Vortex's primary sidebar. The rest of the widgets will remain in sidebar but how can I move Meta widget to footer?

    Thanks

  2. shamratdewan
    Member
    Posted 11 months ago #

    cant you see the meta widget from appearance >> widget. if not try commenting //wp_meta();

  3. ModularBase
    Member
    Posted 11 months ago #

    Please wrap your sidebar code. Select all the code and click the "code" button above the text area. Then update.

  4. Reaven
    Member
    Posted 11 months ago #

    Ok I wrapped the code. I went to Appearance and removed the Meta widget from the sidebar so it disappeared.

  5. ModularBase
    Member
    Posted 11 months ago #

    Look in Appearance > Editor.
    Do you have a footer-sidebar.php or something similar? This would be for setting widgets into the footer.

  6. Reaven
    Member
    Posted 11 months ago #

    No, there is no footer-sidebar.php.

  7. ModularBase
    Member
    Posted 11 months ago #

    Nothing similar either?
    No other Widget Areas in your Appearance > Widgets besides the one sidebar?

  8. Reaven
    Member
    Posted 11 months ago #

    I actually searched around and added this to the functions.php :

    register_sidebar( array(
            'name' => __( 'First Footer Widget Area', 'twentyten' ),
            'id' => 'first-footer-widget-area',
            'description' => __( 'The first footer widget area', 'twentyten' ),
            'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
            'after_widget' => '</li>',
            'before_title' => '<h3 class="widget-title">',
            'after_title' => '</h3>',
        ) );

    to add a new widget and then went to Appearance > Widgets and saw the newly created widget area named "First Footer Widget Area". Then I dragged "Meta" to that area but I couldn't figure out how to make that appear in footer..Anyway actually what I did to solve it was I deleted these divs:

    <div class="widget widget_meta widget-widget_meta">
       <div class="widget-wrap widget-inside">

    The ul tags and everything between them stayed and it worked and everything functions fine. Given that I'm a novice with no PHP knowledge I'm still very puzzled about how these codes function. WordPress has a really steep learning curve!
    Thanks.

  9. ModularBase
    Member
    Posted 11 months ago #

    Did you add that to the Vortex theme?
    If so, it will disappear the next time the theme is updated.
    Need to use a Child Theme for any alterations. http://codex.wordpress.org/Child_Themes

  10. Reaven
    Member
    Posted 11 months ago #

    I added the register_sidebar to the main functions file not to the Vortex functions file. I already made lots of changes to the Vortex files especially the style.css without creating a child theme. :/

Reply

You must log in to post.

About this Topic