WordPress Content Functions

These are the pre-define function defined in wordpress we just need to use 
it directly where we wanted.
the most common functions we normally use is get title , get site url etc.
So basically  these are for beginners  and you become expert while regular using this.
there are comment with every function to explain its functionality. 


// title of the post


<?php the_title(); ?>


// web site url 


<?php echo site_url(); ?>


// web site name 


<?php echo get_bloginfo(); ?>

// post body 

<?php 
if ( have_posts() ) : the_post();
the_content();
endif;
?> 


// get custom value of the post


<?php 
$cusomVal = get_post_custom_values('name_of_custom_value', $post->ID);
echo $cusomVal[0] ;
?>


// get post thumbnail 

<?php the_post_thumbnail(); ?>


// get thumbnail url

<?php  
$post_thumbnail_id = get_post_thumbnail_id($post->ID);
$post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );
?> 


// post per page attributes (give the required number of post on the page)
<?php
  $args = array( 'posts_per_page' => 5, 'offset'=> 0 );
  $myposts = get_posts( $args );
?>

// limited post text on the page (put this on the place the_content())and add ellipse in the end


<?php the_excerpt(); ?>


// get published date 
<?php echo get_the_date(); ?>

</pre>
<pre>