Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change the tittles in page


  • akenach
    Participant

    @akenach

    Hello

    I need change the tittle in some pages, like “messages” or “profile” , in head apears this….<h1>Username</h1> … and i need change to “messages” or “profile” .

    Would someone know how to help me solve the problem?

    Thanks for you time

Viewing 7 replies - 1 through 7 (of 7 total)

  • Prashant Singh
    Participant

    @prashantvatsh

    Hi,

    You can install a plugin like https://wordpress.org/plugins/loco-translate/ and then can easily change the text.

    You can also check https://codex.buddypress.org/getting-started/customizing/customizing-labels-messages-and-urls/

    Thanks


    akenach
    Participant

    @akenach

    OK i try¡

    Thanks¡


    Prashant Singh
    Participant

    @prashantvatsh

    Great, you are welcome 🙂


    akenach
    Participant

    @akenach

    @prashantvatsh It does not work, the variables that it puts in the header are not included in the translation document. The system takes the user name and prints it in the header, what I need is to know where it prints to be able to change it.

    Anyway thank you very much


    Prashant Singh
    Participant

    @prashantvatsh

    Please send the screenshot. If I am correct you are asking to change the link text in menu(header menu), right?


    akenach
    Participant

    @akenach

    No exactly, i have a template for all “buddypress.php” in this template have in <h1> this…

    <div id=”barra_titulo_cursos”>
    <h1><?php the_title(); ?></h1>
    </div>

    But… in some cases, for “messages” pages, apears the Username, not apears tittle “Messages” and this is my problem.

    I have a little solution but i dont like, some like this:

    <div id=”barra_titulo_cursos”>
    <h1>
    <?php
    $mypage = trim( $_SERVER[“REQUEST_URI”] , ‘/’ );
    if($mypage = “members/akenach”) {
    $tit_page = “Account”;
    } elseif ($mypage = “members/akenach/messages”){
    $tit_page = “Messages”;
    } else {
    $tit_page = the_title();
    }
    echo $tit_pagina ;
    ?>
    </h1>
    </div>

    What is your opinion about this patch ?


    akenach
    Participant

    @akenach

    The final script is like this:

    <h1>
    <?php
    global $user_ID;
    $usuario_logeado = bp_core_get_username( $user_ID );
    $pagina = trim( $_SERVER[“REQUEST_URI”] , ‘/’ );

    if ($pagina == “members/” . $usuario_logeado . “/messages”){
    $titulo_pagina = “Messages”;
    } elseif ($pagina == “members/” . $usuario_logeado) {
    $titulo_pagina = “Account”;
    } else if ($pagina == “members/” . $usuario_logeado . “/messages/starred”) {
    $titulo_pagina = “Messages”;
    } else if ($pagina == “members/” . $usuario_logeado . “/messages/sentbox”) {
    $titulo_pagina = “Messages”;
    } else {
    $titulo_pagina = the_title();
    }

    echo $titulo_pagina;
    ?>
    </h1>

    And make solution of problem …

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.
Skip to toolbar