WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Widgets Position on Install of Custom Theme (7 posts)

  1. mattlitzinger
    Member
    Posted 1 year ago #

    I am almost done building my first custom theme, and I am working on widget positioning. On a clean WP install, the default widgets appear in the sidebar of the design, but my layout has instead, three footer widget areas. I would like the default widgets to load there on install instead of in the sidebar.

    Is there any way to manipulate this or split up which widgets display in each widget area?

    Thanks.

  2. Cascus
    Member
    Posted 1 year ago #

    A plugin I found useful is the Widget Wrangler. It may be the answer you are looking for. Furthermore, you can create multiple widgets and assign different widgets per page or just the three for the entire site. See what you think.

    http://wordpress.org/extend/plugins/widget-wrangler/

  3. Mohit Kumar
    Member
    Posted 1 year ago #

    Hi Mat,
    You can use your footer as a sidebar, logically it will be called as a sidebar, but you can load it inside your footer.php

  4. mattlitzinger
    Member
    Posted 1 year ago #

    Thanks, I am calling the widgets from a file called footer-sidebar.php. The widgets load fine, but the all load in the first column. I would like them to be spread out over three columns on install.

  5. mattlitzinger
    Member
    Posted 1 year ago #

    Cascus,
    Thanks for your reply, but this is something I would like to happen from a clean install.

  6. mattlitzinger
    Member
    Posted 1 year ago #

    Here is the code I used to acheive this. Just add the following inside each sidebar where you want to add default content.

    <?php
        if ( ! dynamic_sidebar( 'sidebar-5' ) ) {
            the_widget( 'WP_Widget_Calendar' );
        }
    ?>

    Source: http://stackoverflow.com/questions/10203413/how-to-add-default-widgets-to-a-custom-dynamic-sidebar

  7. mattlitzinger
    Member
    Posted 1 year ago #

    This thread is closed.

Topic Closed

This topic has been closed to new replies.

About this Topic