This topic has 3 replies, 2 voices, and was last updated 8 years by Radu.

  • Author
  • #130347
     adeon
    Participant

    I have a modified page template that generates content, and I need to change the page title dynamically.

     

    Ive search through headers.php in the theme folder and the page-parts but cannot find where to change this?

     

    Thanks!

     

    Ad

    #130413
     Radu
    Moderator

    Hi,

    Do you have tried this file : /wp-content/themes/kleo/page-parts/general-title-section.php ?

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
    #130557
     adeon
    Participant

    No I need to change the <TITLE> Meta Tag.. I ended up just putting a new piece of code into the header.php

    COPY CODE
        global $my_title;
    
        if ($my_title) {
             echo '<title>'.$my_title.'</title>';
        }
    

    then in my_template_file.php I just set the global before the get_header();

    COPY CODE
    ...
    global $my_title;
    $my_title = "This is my new Meta Title";
    get_header();
    ...
    
    #130566
     Radu
    Moderator

    Hi,

    If you do this operation only for have custom title for posts or for pages, you can use seo by yoast…

    Let me know if it’s ok using SEO by Yoast / https://wordpress.org/plugins/wordpress-seo/

    Cheers
    R.

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution
Viewing 4 posts - 1 through 4 (of 4 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?