WordPress.org

Ready to get started?Download WordPress

Forums

How do I call meta tags from static pages to WP header? (2 posts)

  1. PipSqueak
    Member
    Posted 7 years ago #

    I'm using a static front pages and a few other static pages, these static pages are all calling wordpress headers and footers.

    However, these pages do not display any meta keywords or description since they are not wordpress documents.

    How do I make it so that I can put a few codes of keywords and description on the static page and it'll be called into the wordpress header??

    Thanks

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

    Depends on the theme, of course, but with 95% of them:

    function put_this_stuff_in_the_header()
    {
    echo "<meta whatever....>";
    echo "<meta whatever else....>";
    }
    add_action('wp_head','put_this_stuff_in_the_header');

    Do this at the top of your page, before you include the header.php and such.

Topic Closed

This topic has been closed to new replies.

About this Topic