How to add dynamic meta description for wordpress blog

Hi friends, In this post i would like to explain about how to maintain dynamic meta description for a wordpress blog. No need to add any plugins to maintain meta description. Using this method, we can have meta description

how to add dynamic meta description for wordpress blog  | Anil Labs

how to add dynamic meta description for wordpress blog | Anil Labs

To add meta description to your blog with few steps.

Step 1:

Open header.php form your theme folder

Step 2:

Add below code in your file

 <meta name="description" content="
<?php if (have_posts()&& is_single()):
           while(have_posts()):the_post();
                the_excerpt_rss(20,2);
           endwhile;
      else: ?>Anil Labs , Web Programming Blog and maintained by Anil Kumar Panigrahi.This blog covers PHP , OSCommerce, CakePHP ,CodeIgniter, JavaScript, Smarty ,Drupal , Articles , facebook app, facebook pages and joomla .
     <?php endif; ?> "

 />

Step 3:

Save it and have a fun. Check the view source
From now we can get meta description dynamically for each and every post.

Anil Kumar Panigrahi

With more than 10 years experience in PHP and Founder of Anil Labs, a blog for PHP and related posts. contributed posts regarding CodeIgniter, CakePHP and Learn PHP online ... Contact : [email protected]

You may also like...

1 Response

  1. Thank you for your information .

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.