Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #279058

    Hello,

    How can I change the title of a page? For example, if I name a page ‘About Us’ – then the page title shows as ‘About Us’. Is there a way to customize that without having to change the page name?

    Thanks in advance for your help!

    #279204

    Hi Sally!

    Thank you for visiting the support forum!

    Add something like this on functions.php to change the title of a certain page:

    add_filter('avf_title_args', 'avf_change_page_title', 10, 2);
    function avf_change_page_title($args,$id) {
    	if(is_page('About Us')) {
    		$args['title'] = 'Awesome Title';
    	} elseif (is_page('Products')) {
    		$args['title'] = 'Shop';
    	}
    	return $args;
    }

    The “About Us” page will have the “Awesome Title” as title and the “Products” page to “Shop”.

    Regards,
    Ismael

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