Jump to content

Archived

This topic is now archived and is closed to further replies.

Fed51

Wordpress plugin - seems ok, but broken

Recommended Posts

I'm trying to use post content as meta keywords content

It will insert the meta tag into the head just fine, but content="" is empty

 

Here's the code so far:


function autokeys() {

  if (is_single())
     	{
  echo '<meta name="keywords" content="';
      }
  foreach((get_the_content()) as $post)
  if (is_single())
      {
  echo  $post->post_content; 
   	}
  if (is_single())
     	{
  echo '" />';
      }
      
}
add_action('wp_head', 'autokeys');

 

any help would be much appreciated.

also, if you know how to only use the first XX number of characters or words, a tip on that would be handy as well

 

thanks in advance,

da fed

Share this post


Link to post
Share on other sites

YOUAREtehSCENE,  I've already explained what I am trying to do.  What I am not trying to do is teach you how to read.  ;)

Share this post


Link to post
Share on other sites

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.