Hi Jason,
Apologies for the delay.
Here is a new pastebin that includes the RankMath code: https://pastebin.com/38jYibS7
Let us know how this works for you. Thank you.
Haha, getting somewhere – the plugin is definitely disabled now but it has stripped out the title and meta tags completely.
Here’s the code I’m using for dynamic titles:
// DYNAMIC PAGE TITLE FOR COUNTRY FILTERING
function dynamic_directory_title() {
if(!empty($_GET['country'])){
$cc = $_GET['country'];
$countries = New WC_Countries();
$all_countries = $countries->get_countries();
return 'Emerging fashion designers in ' . $all_countries[$cc] . ' - Rize';
}
return;
}
add_action( 'pre_get_document_title', 'dynamic_directory_title' );
If I deactivate the Rank Math plugin via the admin UI this works fine.
Any thoughts?
Hi Jason,
Thanks for the follow up.
Please note that you can also dynamically change the RankMath page titles using the same logic by making use of the following code:
/**
* Filter to change the page title.
*
* @param string $title
*/
add_filter( 'rank_math/frontend/title', function( $title ) {
if( is_page( '1161' ) && !empty($_GET['country'])) {
$cc = $_GET['country'];
$countries = New WC_Countries();
$all_countries = $countries->get_countries();
return 'Emerging fashion designers in ' . $all_countries[$cc] . ' - Rize';
}
return $title;
});
I hope this info helps. Thank you
That’s perfect Michael – thanks so much for all of your help 🙂
Hello,
We are super happy that this resolved your issue. If you have any other questions in the future, know that we are here to help you.
If you don’t mind me asking, could you please leave us a review (if you haven’t already) on https://wordpress.org/support/plugin/seo-by-rank-math/reviews/?rate=5#new-post about your overall experience with Rank Math? We appreciate your time and patience.
If you do have another question in the future, please feel free to create a new forum topic, and it will be our pleasure to assist you again.
Thank you.