Forums

[resolved] Google description for a site (4 posts)

  1. rcal1
    Member
    Posted 2 years ago #

    I think I remember reading somewhere where you can add a description in wordpress. And that will appear under your site on Google search. Just wondering if I'm right, and if so how to do it...

    Thanks, Ray...

  2. hilj
    Member
    Posted 2 years ago #

    With a plugin: http://wordpress.org/extend/plugins/all-in-one-seo-pack/

    With a custom field:
    -Create a custom field named description
    -Add the following to your header.php file between the head.

    <meta name="description" content="<?php $description = get_post_meta($post->ID, 'description', true);
    		if($description) { ?>
    			<?php echo $description; // get the description if it exests ?>
    	<?php } else { ?>
    		some generic description in case you forgot to fill the description customfield
    	<?php } ?>
    " />
  3. rcal1
    Member
    Posted 2 years ago #

    Thanks hilj, I appreciate you help on this...Ray...

  4. ruthstokes
    Member
    Posted 2 years ago #

    Hi, I'm having the same problem, but just tried this and it didn;t work for me. Any chance this code is wrong??

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.