• But I’d like to do it myself, editing the template files. I know I have to edit the headер.php file and as I did so I try putting the_excerpt() where I wanted the excerpt to show up (the meta description tag), but all that came up was “
    and nothing of the rest of the static meta text I added after the excerpt call.

    I searched around and found out that the_excerpt() can only be used in The Loop and does not contain anything outside of it. Or in other words it’s not that easy to do.

    Also I tried copying the function contained in the plugin add-meta-tags but it didn’t seem to work, or perhaps I didn’t use it correctly?

    PS. I know you might say just use some plugin, but I don’t want to do that. So if you could help me out to figure this out I’ll be very grateful!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter assassinbg

    (@assassinbg)

    No ideas? ??

    Have you tried looking through the source of *my* plugin?

    https://guff.szub.net/2005/09/01/head-meta-description/

    A clue for how it collects the post data outside The Loop is found in the scoping of $wp_query to global (or alternatively, the $post object).

    Note that just dumping the_excerpt() into the description meta tag will lead to headaches.

    Thread Starter assassinbg

    (@assassinbg)

    Hello Kafkaesqui,

    Thank you very much for referring me to your plugin. I studied it and found out how to call for stuff from outside the loop. I have now added dynamic meta description tags to my blog and I’m really happy. ??

    Thanks again!

    Regards,
    TLG

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘I would like to add dynamic meta description tags.’ is closed to new replies.