Support » Plugins » Can a plugin filter the sidebar?

  • 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?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter ramdyne

    (@ramdyne)

    Oh, I forgot, I’m running wordpress 1.5.1.1

    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.

    Thread Starter ramdyne

    (@ramdyne)

    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!

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

    Thread Starter ramdyne

    (@ramdyne)

    Right, echo() is your friend 😉

    Thread Starter ramdyne

    (@ramdyne)

    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.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can a plugin filter the sidebar?’ is closed to new replies.