WordPress SEO: Add meta description to your theme

Hello friends
Today I am going to show how to add meta description in your wordpress custom theme. Unfortunately there is no meta data in wordpress default theme except the page title and description. Its very easy to write only few line of code.

 

<?php if (  (is_home()) || (is_front_page())  ) { ?>
<meta name="description" content="Blog description goes here" />
<?php } elseif (is_single()) { ?>
<meta name="description" content="<?php the_excerpt();?>"/>
<?php } ?>

Oky done. Just put this code into your head section and save it. Refresh and check the meat information again. 

Thanks for reading...
Advertisements

Zen Coding problem in Sublime Text 2

Hello friends
Sublime Text is one of the most famous text editor into the programmers. There are lot of programming flexibility to work in sublime text. Zen Coding is one of them. For example, if you want to write some basic structure of HTML5, then you can just write down the following codes-

html:5

then hit the TAB button. Zen coding will automatically brings the basic structure of HTML5, such-

<!doctype html>
<html lang=”en”>
<head>
<meta charset=”UTF-8″>
<title>Document</title>
</head>
<body></body>
</html>

Amazing! Really its helpful for boost-up your programming knowledge.
But unfortunately sometimes it is now working properly. In this case, you have a alternative way to do it. Lets start-

First copy the text from following link-

http://wbond.net/sublime_packages/package_control/installation

Open sublime text editor-

  1. Click VIEW>SHOW CONSOLE then paste the copied text and hit ENTER
  2. Restart your Sublime Text
  3. Run “Package Control: Install Package” command, find and install Emmet plugin.
  4. Restart ST editor (if required)

Oky. Now restart your sublime text editor. And enjoy the zen coding.

[ATTENTION: THIS IS ONLY FOR WINDOWS OS]

Thanks for reading.