Hello!
My apologies for getting back to you this late, we had some power issues; so I couldn’t access all my resources quickly.
We have some title-related filters in place. What you’d want to do is prepend the Coupons codes for
to the title for the post type.
This is what your custom filter will look like, you just need to adjust the my_post_type
value:
/**
* Modifies the auto-generated title for The SEO Framework.
*
* @param string $title The title.
* @param array|null $args The title arguments.
*/
add_filter( 'the_seo_framework_title_from_generation', function( $title, $args ) {
if ( null === $args ) {
// Front-end, main query loop...
if ( is_singular() ) {
// Singular...
if ( 'my_post_type' === get_post_type() ) {
$title = "Coupon codes for $title";
}
} else {
// Taxonomy...
}
} else {
// Custom query...
if ( empty( $args['taxonomy'] ) ) {
// Singular...
if ( 'my_post_type' === get_post_type( $args['id'] ) ) {
$title = "Coupon codes for $title";
}
} else {
// Taxonomy...
}
}
return $title;
}, 10, 2 );
You can extend this functionality indefinitely. Please note, however, that the filter above does not affect custom meta titles. For that, you’d want to use the_seo_framework_title_from_custom_field
, and also check if the first parameter is entered.
I hope this helps! Cheers ??