WordPress.org

Ready to get started?Download WordPress

Forums

Hooking the sidebar (6 posts)

  1. jalenack
    Member
    Posted 9 years ago #

    Hey,

    I'm writing a plugin and was trying to add some code to the sidebar automatically through an action.

    wp_meta is the only one in the sidebar....any other ways I could get some code into the sidebar...it doesn't really matter where it ends up all that much. I'd just like to have that as an option to less-savvy users who wanted to activate and go.

  2. Kafkaesqui

    Posted 9 years ago #

    wp_meta is the only hook I'm aware of at this time for the sidebar. You could always provide a template tag, but I suspect not doing this is in regards to those "less-savvy" folk.

    I guess if you're really crafty about it you could figure a way to write to the current theme's sidebar.php (if it exists), but it's not something I would suggest.

  3. Or, have the user manually add a PHP call for the plugin into the sidebar.

  4. jalenack
    Member
    Posted 9 years ago #

    [ edit ] ^^ that's how I have it now... [/ edit ]
    macmanx, I searched the codex extensively before posting this...none of those current hooks are any good for this. And strange, I didn't find the forum topic when I searched the forums...Still didn't help me though.

    Do you think I could filter through wp_list_pages ();. It's certainly hacky, but it may be the only way. I could also write it into the searchform.php part of the template...that would probably be fairly easy..

    Maybe I should just forget it and require that the users add the display-my-plugin function manually..heh

  5. Kafkaesqui

    Posted 9 years ago #

    jalenack, just keep in mind that what you have in a template isn't necessarily what others will have. Some themes may not place wp_list_pages on the sidebar, and most don't provide a searchform.php. All themes are not made to the Kubrick specification.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.