disable/change title programmatically
-
Hi, I have a problem with the title tag. I am using a customized twentyseventeen theme with the
add_theme_support( 'title-tag' )
feature and yoast installed.For some page templates I want to set the title programmatically and tried to do that using the yoast hooks
function custom_title( $title, $arg1 ){ $title = $arg1.' - '.get_bloginfo('name'); return $title; } add_filter('wpseo_title','custom_title', 10, 2); apply_filters( 'wpseo_title', 'test', $arg1);
As you can see I want to pass arguments to the add_filter functions but apply_filter only returns whats inside the custom_title but doesn’t change the <title> tag.. how do I do that?! Ofc this would work without passing arguments and using only add_filter but I need to pass arguments.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘disable/change title programmatically’ is closed to new replies.