Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1152534

    Hello
    I’ve looked at this post –
    https://kriesi.at/support/topic/post-title-tag-page-post-type-title-change-title/
    But the latest has different code, so I don;t know what to edit –

                                        $label = apply_filters('avf_tag_label_names', $post_type_obj[$key]->labels->name);
    								$output .= "<{$heading} class='post-title tag-page-post-type-title {$css}'>{$label}</{$heading}>";

    I want to be able to replace the generic word ‘Posts’ with whatever tag was clicked, eg, ‘USA’. I would also like to add in some text that says something like ‘Tag results for’ before the tag name, eg, ‘USA’.

    Please advise and thank you in advance.

    #1153691

    Hey webWahine,
    Sorry for the late reply, I tried to take a look at your site but it seems down right now, but I was able to achieve this please edit the file /enfold/tags.php and at about line 125 you will find:

    $label = apply_filters('avf_tag_label_names', $post_type_obj[$key]->labels->name);
    echo "<{$heading} class='post-title tag-page-post-type-title {$css}'>{$label}</{$heading}>";

    Please note this code is also at line 75, but you need to edit the code at 125.
    change to:

    $label = apply_filters('avf_tag_label_names', $post_type_obj[$key]->labels->name);
    $current_tag = single_tag_title("", false);
    echo "<h3 class='post-title tag-page-post-type-title'>Tag results for ".$label."<span>: ".$current_tag."</span></h3>";

    for this result:
    2019-11-04-060859
    to remove the text “Posts” use this code:

    $label = apply_filters('avf_tag_label_names', $post_type_obj[$key]->labels->name);
    $current_tag = single_tag_title("", false);
    echo "<h3 class='post-title tag-page-post-type-title'>Tag results for<span>: ".$current_tag."</span></h3>";

    for this result:
    2019-11-04-061252

    Best regards,
    Mike

    #1153786

    That worked perfectly! Thank you so much :) All done!

    #1153813

    Hi,
    Glad we were able to help, we will close this now. Thank you for using Enfold.

    For your information, you can take a look at Enfold documentation here
    For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)

    Best regards,
    Mike

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Change page title for tag click results’ is closed to new replies.