Posted By

itsmrchris on 10/25/12


Tagged

php wordpress keyword Yoast


Versions (?)

WP Yoast display Focus Keyword


 / Published in: PHP
 

URL: http://wordpress.org/support/topic/plugin-wordpress-seo-by-yoast-using-the-focus-keyword-in-php

Add this to functions.php and then you can call the focus keyword anywhere you want with:

<?php wpseoFocusKW();?>

  1. /*--------------------------------------*/
  2. /* Use WP SEO Focus Keyword in PHP
  3. /*--------------------------------------*/
  4. if(!function_exists('wpseoFocusKW'))
  5. {
  6. function wpseoFocusKW()
  7. {
  8. $focuskw = wpseo_get_value('focuskw', $post->ID);
  9. echo $focuskw;
  10. }
  11. }

Report this snippet  

You need to login to post a comment.