Forums

[resolved] Display one widget on custom page? (4 posts)

  1. Supah Fly
    Member
    Posted 2 years ago #

    I am making a custom home page or portal and it's going to be integrated with wordpress, vbulletin, and other custom things that I have created myself in PHP.

    I want to add the wp-polls widget to a sidebar on the main page, it's displayed on my blog sidebar but I want to add it to my main page with full functionality.

    Just adding the widget to my sidebar would work right? If so, I would need code for displaying one widget.

  2. Mark / t31os
    Moderator
    Posted 2 years ago #

    Register a second sidebar widget, then call the custom sidebar...

    Firstly register another dynamic sidebar..

    if ( function_exists('register_sidebar') )
    	register_sidebar(array(
    	'name' => 'Somename',
            'before_widget' => '',
            'after_widget' => '',
            'before_title' => '<h2>',
            'after_title' => '</h2>',
        ));

    Then call it where you want it...
    dynamic_sidebar('Somename');

    You can then just add widget to that new sidebar via admin.....

  3. Supah Fly
    Member
    Posted 2 years ago #

    Thanks, that worked.

  4. Mark / t31os
    Moderator
    Posted 2 years ago #

    I wanted to do the same thing recently myself, and i found this method the easiest approach... glad i could help... :)

Topic Closed

This topic has been closed to new replies.

About this Topic