-
Hello, sorry for my English.
Please is it possible to automatically insert focus-keyword in post content using rankmath shortcode “%focuskw%”?
Example below is for yoast seo plugin.
If you want a shortcode for Yoast to output the keyphrase automatically:
function wpso_61018203_output_yoast_keyphrase() { // Make sure Yoast is installed/active. if ( class_exists( 'WPSEO_Meta' ) ) : // Hold the global post object. global $post; return WPSEO_Meta::get_value( 'focuskw', $post->ID ); endif; } add_shortcode('yoast_kw', 'wpso_61018203_output_yoast_keyphrase' );
You can then do this [‘yoast_kw’] in your content, or use echo do_shortcode(‘[yoast_kw]’); in your template.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The ticket ‘%focuskw% Insert Inside Post’ is closed to new replies.