Forum Replies Created
Viewing 3 posts - 1 through 3 (of 3 total)
-
AuthorPosts
-
thewebco76
ParticipantThis only replaced the title with the ID (you have $r->id in the filter)
But this pointed me to something useful – so thanks! Shared in case you ever need it for anyone else :
add_filter( 'asp_results', 'asp_force_yoast_title', 10, 1 ); function asp_force_yoast_title( $results ) { foreach ($results as $k => &$r ) { $r->title = apply_filters('the_title', $r->title); $newtitle = 'My Site Name Replacement'; $realtitle = get_the_title($r->id); $r->title = str_replace( array("%%sitename%%","%%sep%%","%%title%%","%%page%%"), array($newtitle, " | ", $realtitle,""), "$r->title" ); } return $results; }-
This reply was modified 4 years, 10 months ago by
thewebco76.
thewebco76
ParticipantWe are not using the title; rather customer field for the title. ( they use page titles internally on private site )
So I assigned _yoast_wpseo_title as primary title field.
But I am now seeing in your documentation that it looks like you only support this field if they are typed in. ( not auto generated)
Is there a workaround for this – where I can use the yoast seo field and have the results fire after they is rendered?
thewebco76
ParticipantAdding screenshot so you can see
No ftp / admin access needed at this point but can get it if the question can’t be answered simply.
-
This reply was modified 4 years, 10 months ago by
-
AuthorPosts
Viewing 3 posts - 1 through 3 (of 3 total)