This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • in reply to: Yoast title field #34211
    thewebco76thewebco76
    Participant

    This 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 thewebco76thewebco76.
    in reply to: Yoast title field #34201
    thewebco76thewebco76
    Participant

    We 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?

    in reply to: Yoast title field #34195
    thewebco76thewebco76
    Participant

    Adding 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.

Viewing 3 posts - 1 through 3 (of 3 total)