For example I have title “The Battleship Trailer”
so it will generate keyword like this
“best , player, of, the, world”
how can i do it ?
I want to apear in html like this…
First:The
Second:Battleship
Third:Trailer
<meta name="keywords" content="<FirstWord>,<second>,<third>"/>
More exactly i want to split the title in words.
I use WordPress
This would join the words separated by a space in
$string
with a comma. Obviously replace$string
the proper variable.It might be better to get the post’s slug. That will sanitize and strip out any shorter words that won’t be of any value to search engines. Then explode and implode with PHP…
Here how:
Let me know if this worked for you…
Reference: http://codex.wordpress.org/Template_Tags/get_the_title
Reference: http://php.net/manual/en/function.implode.php