• Resolved eswe

    (@eswe)


    oceanwp gives the archive-page from events calendar the page header title “Events” (translated into German “Veranstaltungen”) I have found the following code

    // Alter Blog Title
    function my_alter_page_header_title( $title ) {

    // Change the posts title to their actual title
    if ( is_singular( 'post') || is_category() || is_tag() ) {
    $title = 'My Blog Title';
    }

    // Return the title
    return $title;

    }
    add_filter( 'ocean_title', 'my_alter_page_header_title', 20 );

    can someone tell me how to change “is_singular( ‘post’) || is_category() || is_tag()” so that the title is changed?

    thanks for your help

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @eswe,

    Thank you for reaching out,

    First of all, check your plugin’s settings, perhaps they have an option to change the string there.

    If they don’t provide this feature, then you must update the code, your current code only works on posts, so you need to update this part like this:

    // Alter Events Archive Page Title
    function my_alter_page_header_title( $title ) {
    
        // Check if it's the Events Calendar archive page
        if ( function_exists( 'tribe_is_event' ) && tribe_is_event() ) {
            $title = 'Your Custom Events Title'; // Replace with your desired title
        }
    
        // Return the title
        return $title;
    }
    add_filter( 'ocean_title', 'my_alter_page_header_title', 20 );

    Note: The Events Calendar archive is typically identified using the tribe_is_event() function, which checks if the current page is part of the Events Calendar. So that code is an example, kindly check your plugin functions.

    Hope it helps.
    Best Regards

    Thread Starter eswe

    (@eswe)

    Hallo @skalanter,

    That is exactly what it is. Thank you very much…

    You’re most welcome.
    I’m glad that the solution was helpful.

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