• is it possible to place widgets anywhere with a wordpress theme or in pages?? if so, how this achieved.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Yes.

    And you need to set up a widget-ready area in exactly the same way as you set up a widget-ready sidebar. For example, I widgetize the home page on some of my themes:

    FUNCTIONS.PHP

    if (function_exists('register_sidebar')) {
    	register_sidebar(array(
    		'name'=> 'Main',
    		'id' => 'main',
    		'before_widget' => '<div class="widget_box side">',
    		'after_widget' => '</div>',
    		'before_title' => '<h3>',
    		'after_title' => '</h3>',
    	));
    	register_sidebar(array(
    		'name'=> 'Homepage',
    		'id' => 'homepage',
    		'before_widget' => '<div class="widget_box">',
    		'after_widget' => '</div>',
    		'before_title' => '<h3>',
    		'after_title' => '</h3>',
    	));
    }

    Then I simply insert <?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('Homepage')) : ?> into the homepage template wherever I want the widgets to be placed.

    Thread Starter jainsy

    (@jainsy)

    thank you very much for your reply

    Sounds great but what if you want 3 widgets instead of one?

    You could try out the Widgets on Pages plugin I’ve written… it allows you to add entire sidebar areas to page and post content

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘placing widgets outside of the sidebar’ is closed to new replies.