phprockers-logo

Important functions in Wordpres

 Wordpress Functions:
================
get_the_excerpt() -  It can be used to get the post excerpt content in the current post.

get_post($post->ID) - It can be used to get the post details about current post. It has title,categoryid, category name, post status etc. Here post->ID is optional.

get_the_post_thumbnail($page->ID,array(150,200),'thumbnail') - It can be used for retrive the thumbnail image for the post.

the_title() - It can be used for retrive the title for current post.

get_the_title(ID) - It can be also used to get the title for the post.

get_cat_name( $cat_id ) - It can be used to get the category title for that category id.

get_post_type(ID) - get the post type for that post id.

get_the_author() - get the author name for current post.

get_categories() -  get the all the categories in wp.

get_the_content() - It can be used for the get the content for current post.

0 comments:

Post a Comment