Setting custom titles featured pages
-
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)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Setting custom titles featured pages’ is closed to new replies.