WordPress.org

Ready to get started?Download WordPress

Forums

adding a widget-only plug in as html code in the sidebar (7 posts)

  1. tarr
    Member
    Posted 6 years ago #

    I've my sidebar as I like it. I would like to add a plug in which only comes as a widget ( d4rss http://wordpress.org/extend/plugins/d4rss/ )
    If I activate this I loose all my sidebar elemnts. How can I solve this?

  2. moshu
    Member
    Posted 6 years ago #

    You may try to restrict the "widgetized" portion of your sidebar.php to only display that widget... and leave the rest of the code 'outside' of the dynamic sidebar's if/endif code.

  3. tarr
    Member
    Posted 6 years ago #

    That seems genious!
    But, how do I achieve this? Arte there special <widgets on/> <widgets off/> tags to put in the php of teh sidebar? :?

  4. moshu
    Member
    Posted 6 years ago #

    Every widgetized sidebar must have these lines:
    a) beginning -

    <?php if ( !function_exists('dynamic_sidebar')
            || !dynamic_sidebar(rightsidebar) ) : ?>

    ...all that stuff here...
    b) ending -
    <?php endif; ?>

    Everything in between will be overridden by the widgets if you use them.
    However, everything outside of this code will appear normally in the sidebar (above or below the widgetized portion), as you edited.

  5. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    In the long run, a better way would be to convert your existing sidebar to be all widgets instead. It doesn't take much effort.

  6. tarr
    Member
    Posted 6 years ago #

    Ok, otto 42, I hoped this could be done, but, call me stupid, I've not understood how, yet.

    The more I think about it, the less I like this widget feature. It is good for people who cannot cut'n'paste some code, but it conflicts with older WP plugins :(

  7. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Not really. You can always use an ExecPHP widget for those older plugins that don't have widgets of their own: http://ottodestruct.com/blog/2006/04/09/fun-with-widgets/

Topic Closed

This topic has been closed to new replies.

About this Topic