• I’m making a theme and confused about where to put the wp_meta() tag. I have a read a couple places which say ‘right before closing tag of the sidebar <aside>’. Plugin API hooks section of the handbook says it should be included in every theme, typically in the menu or sidebar and to look at the core themes for examples, but I can’t find it in any of them dating back to twentysixteen. Also the function reference page says it gets called by default, so I’m not sure if that means you don’t need to explicitly include it at all.

    By default, wp meta() is called immediately after wp_loginout() by sidebar.php and the Meta widget, allowing functions to add new list items to the widget.

    Although, I can’t get a function hooked to wp_meta to echo anything unless I include the tag manually or the Meta widget is active. Is it the case you don’t need the tag as long as users have the ability to add the meta widget?

    Thanks for your help!

Viewing 3 replies - 1 through 3 (of 3 total)
  • @peterste Please follow this link for reference.

    wp_meta()
    Typically goes in the

    • Meta
    • section of a Theme’s menu or sidebar; sidebar.php template. Example plugin use: include a rotating advertisement or a tag cloud.

    Moderator bcworkz

    (@bcworkz)

    It’s only called by default in the Meta widget. Some older twenty* themes may have used it in their sidebar.php outside of the widget, IDK. Basically, call it where ever you might want to allow other code to output meta related content. If you don’t want to provide that functionality I think that’s OK too. Especially since users are free to add the Meta widget if you provide any widget area at all.

    Thread Starter Peter Steele

    (@peterste)

    thank you @bcworkz @pixellanguage this is helpful info.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘correct place in theme for wp_meta()’ is closed to new replies.