-
Hello, Please Refer to this:https://support.rankmath.com/ticket/automate-the-insertion-of-focus-keyword-using-taxonomy-title-as-focus-keyword/#post-341959
When Am Adding Keywords using Function.php/ Rankmath.php am getting this error
After Adding the Code to My Function.Php am getting this error
{ $keywords[] = strtolower($tag->name); } update_post_meta($p->ID, 'rank_math_focus_keyword', implode(", ", array_unique($keywords))); } } $posts = get_posts(array( 'posts_per_page' => 100, 'post_type' => 'tvshows' )); foreach ($posts as $p) { $keywords = []; if (get_the_tags($p->ID)) { foreach ((get_the_tags($p->ID)) as $tag) { $keywords[] = strtolower($tag->name); } update_post_meta($p->ID, 'rank_math_focus_keyword', implode(", ", array_unique($keywords))); } } } add_action('init', 'update_focus_keywords');
How to Fix it?
You must be logged in to reply to this ticket.