Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter webbando

    (@webbando)

    Someone can help me?

    Thanks a lot

    can you elaborate on your question?
    example for instance?

    do you mean: tag as in taxonomy?

    Thread Starter webbando

    (@webbando)

    Example:

    I have a post with title:”Good life” which has one tag:”Past”

    I want that the tag title will be:”Past: Good life”, is it possible?

    instead of
    <?php the_title(); ?>

    you could try and use:

    <?php $posttags = get_the_tags();
    if ($posttags) {
    foreach($posttags as $tag) {
    echo $tag->name . ': '; break;
    }
     } ; the_title();  ?>

    Thread Starter webbando

    (@webbando)

    Doens’t work…

    the code needs to be in the loop.

    what in particular does not work?
    can you post the inserted new code with a few lines before and after ?
    or link?

    Thread Starter webbando

    (@webbando)

    What i want is to insert the title in tag title of the header, not title in loop…

    small adaptation – check for single post, and use the post id in ‘get_the_tags()’:

    <?php if(is_single()) { $posttags = get_the_tags($post->ID);
    if ($posttags) {
    foreach($posttags as $tag) {
    echo $tag->name . ': '; break;
    }
     } ; the_title(); } ?>
    Thread Starter webbando

    (@webbando)

    Doens’t work… ??
    Edit: it works but not with plugin “all in seo pack”

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Name Tag on Post Title’ is closed to new replies.