Yoast SEO
[Plugin: WordPress SEO by Yoast] Using the 'Focus Keyword' in PHP (2 posts)

  1. grfxarmy
    Posted 2 years ago #

    Hi there, wonderful plugin.

    Here is a code snipped for anyone trying to use the "Focus Keyword" in their PHP.

    1) Place the following code into your theme's functions.php file.

    /* Use WP SEO Focus Keyword in PHP
    		function wpseoFocusKW()
    			$focuskw = wpseo_get_value('focuskw', $post->ID);
    			echo $focuskw;

    2) Place this code where you want the Focus Keyword to display.

    <?php wpseoFocusKW();?>

    3) Enjoy your Focus Keyword anywhere you want!**

    **I cannot vouch for it working everywhere on every single theme and plugin, but technically it should work ;)


  2. ThermalStudios
    Posted 2 years ago #

    Revision to my previous post: Works on WordPress 3.5 with Yoast SEO!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Yoast SEO
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic