Tuesday, 17 September 2013

Using "SLUG" how to get post and page content..!!!

SLUG are used in WordPress ( permalinks structure. ).Basically it is a unique name auto generated by word press. You can also change it...You get specific POST and page content by using slug.It is always in small letters with "-".

For example:


Here is the method to get Slug

$slug = get_post( $post )->post_name;
echo $slug; 

Now you have unique name use it and get the specific post and page content by using manual method of POST.

Subscribe Dr-Wordpress for Important Knowledge of wordpress..your's suggestions are most welcomed.

No comments:

Post a Comment