• Hi,

    I have used this snippet to change the 2nd feature page title on https://www.richardsvillas.nl to ‘Diensten’. It’s page-id 12. I am using a childtheme.

    Now I have the english version which is en.richardsvillas.nl (offline at the moment, only admin) and it’s using the same child theme in a multisite wordpress setup. But I don’t know how to program the functions.php so that for the dutch website it says ‘Diensten’ and for the english version ‘Services’.

    add_filter('tc_fp_title' , 'my_custom_fp_titles', 10 ,3);
    function my_custom_fp_titles( $original_title , $fp_id = null , $page_id = null ) {
    
        //assigns a custom title by page id
        $custom_title = array(
            //page id => 'Custom title'
            12 => 'Diensten'
    );
    
        //if no custom title is defined for the current page id, return original
        if ( ! isset($custom_title[$page_id]) )
            return $original_title;
    
        return $custom_title[$page_id];
    }

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter Victor01

    (@victor01)

    Oh and by the way I tried this as well but no luck….

    $custom_title = array(
            //page id => 'Custom title'
            12 => __('[en] Services [nl] Diensten')
        );
    Thread Starter Victor01

    (@victor01)

    Anyone an idea? I now have it the Title changed to ‘Services’ on both sites. Lucky the dutch are not so bad in English. ??

    Thread Starter Victor01

    (@victor01)

    This shouldn’t be that hard I suspect but somehow I can’t figure out what to do. I am desperately in need of some help cause where going to make the German website live this week and this is the only thing I can’t figure out. Really appreciate it if someone could help me with this.

    All the best.
    Victor

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Setting custom titles featured pages’ is closed to new replies.