Skip to:
Content
Pages
Categories
Search
Top
Bottom

Change /blog title

  • Hi all,

    Sorry about the lame question and i am the newbie of buddypress. I want to change the title name of /blog page and I tried to find codes. But can’t find anywhere. And I tried to search here and I found this topic

    http://buddypress.org/forums/topic.php?id=1564#post-7823

    But it doesn’t help me though. I tried to read it and can’t understand.

    I don’t want to create new custom file and called. I just want to change from core codes. Please kindly point out the filename and code to me. Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)
  • @burtadsit

    Participant

    You want to change the title of the page in the browser? I think that’s what you are asking. Each page has a different title based on what it is and what it contains.

    If all you want to do is change the title to the same thing on your site then that is located in the /bpmember/header.php file on line 7 – <title><?php bp_page_title() ?></title>

    If you want to change the title to something else based on what page is being viewed then you’ll have to either alter the core code, which isn’t a good idea, or install a filter.

    The title for each page is determined by the function bp_page_title() in bp-core-templatetags.php

    At the bottom of that function bp calls a filter so that you can change the title without altering either header.php or bp_page_title(). You can install a filter by creating one in your bp-custom.php file like this:

    function my_page_title($with_site_name, $without_site_name){

    return ‘my page title’;

    }

    add_filter(‘bp_page_title’, ‘my_page_title’, 10, 2);

    The parameters that get passed to your new filter are the page titles with and without the site name that the bp_page_title() function is going to use as the page title. Whatever you return from that function will be the page title for *all* pages that use the bp home theme.

    Thanks Burt. I found it. The one i want to change is this one

    } else {

    $title = __( ‘Blog’, ‘buddypress’ );

    from bp-core-templatetags.php bp_page_title() function. Thanks much

    @burtadsit

    Participant

    lol. You had absolutely no need for all that other stuff then. Now you know more than you ever wanted to know about page titles in bp.

    @zenimot

    Participant

    Interesting post. What if I don’t want to change the names of the different parts in the page title, but the order of these parts?

    E.g. standard: “Sitename – Blog – Post” changed to “Post – Blog – Sitename”

    Would that be possible with such a filter?

    @burtadsit

    Participant

    zenimot, by the time the filter gets it the title string is set. You’ll have to parse the string to rearrange things. Or just replace the functionality of bp_get_page_title() inside your filter to arrange things as you want.

    The title will be whatever your filter returns.

    @jeffsayre

    Participant

    @Amhyaut

    It seems that you are wanting to change the slug “blog” to something else. Read this article and see if this is what you’re after:

    https://buddypress.org/blog/how-to/customizable-slugs-in-buddypress/

    @deepbevel

    Participant

    I just want to change the default “My Blog” to my own site name. Are there actually no settings for editing the main pages? does one have to edit php just for that?

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Change /blog title’ is closed to new replies.
Skip to toolbar