Custom function in function.php | WordPress.org

[ad_1]

Hello @phanngocvy27,

We checked your code and found that you are using a hook ‘pg_user_profile_pagetitle’, which is not declared as a hook in the plugin code. It is a function that we are using for WordPress hook ‘wp_title’, this is why the code is not working.

Please use the below code and check:

add_filter(‘wp_title’, ‘custom_profile_title’, 99999999, 2 );
function custom_profile_title ($title, $sep = ”)
{
//code here
}
return $title;
}

Let us know if you still face any issues.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer