WordPress.org

Forums

Can a plugin filter the sidebar? (7 posts)

  1. ramdyne
    Member
    Posted 10 years ago #

    Hi,

    I want a plugin to add some info to the sidebar, but I can't find an appropriate filter hook to do this. The best one I can find is the_contents, but it doesn't work.

    What does work?

  2. ramdyne
    Member
    Posted 10 years ago #

    Oh, I forgot, I'm running wordpress 1.5.1.1

  3. jcraveiro
    Member
    Posted 10 years ago #

    Well, I guess not, since sidebar is not quite a WordPress feature, rather some template fanciness we all enjoy using. :)
    You can, though, make a plugin that will create a template tag to return/echo the info you want, and add:
    <?php if (function_exists('the_name_of_the_tag')) {
    the_name_of_the_tag();
    ?>

    to the sidebar.
    Hope I helped.

  4. ramdyne
    Member
    Posted 10 years ago #

    Hmm, you mean calling my function from the template? Do I echo() my output or is there something else to do?

    Anyway, thanks for the suggestion!

  5. Kafkaesqui

    Posted 10 years ago #

    The API hook you're looking for is wp_meta -- if a theme includes this in the sidebar (not all do, but they should).

  6. ramdyne
    Member
    Posted 10 years ago #

    Right, echo() is your friend ;-)

  7. ramdyne
    Member
    Posted 10 years ago #

    OK, the result of this is now the main article on my website (http://www.ramdyne.nl/). It will now show what song my laptop is playing, using XMMS Song Change plugin.

Topic Closed

This topic has been closed to new replies.

About this Topic