Forums

[resolved] Adding widgets to sidebar overwrites custom sidebar (2 posts)

  1. Stompfrog
    Member
    Posted 2 years ago #

    Hi all,

    I have a wordpress theme which includes a custom sidebar.php file which I have created. This all works fine. I have a new requirement for a free html pod to be added to the sidebar and thought I would be able to use the standard wordpress text widget to achieve this.

    However... when I add the text widget to the sidebar in the widgets section of the admin panel the new widget sidebar completely replaces the existing custom sidebar.php sidebar.

    My question is how can I make use of the built in widgets alongside my own sidebar.php?

    Thanks in advance.

  2. Stompfrog
    Member
    Posted 2 years ago #

    Why do I always answer my own questions just after I give up and post on a forum...

    Answer for anyone else with this problem is make sure you do not have the following line of code or similar in your sidebar.php... oops!

    <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    //sidebar code here
    <?php endif; ?>

Topic Closed

This topic has been closed to new replies.

About this Topic