Posts

Showing posts from October, 2013

How to get the post link in WordPress?

How to get the post link in WordPress? <?=get_permalink(12)?> Where 12 is the id of your post.

How to display post from a category in wordpress?

How to display post from a category in wordpress?  Simply copy and paste the code in your php file and change the category id which one you want to show. <h4>Latest Post</h4>           <ul class="list-blog">  <?php             query_posts(array('category__in' => array(4),'posts_per_page' => 4));             while(have_posts()) { the_post();             ?>             <li>             <?php             $post_thumbnail_id = get_post_thumbnail_id($post->ID);                        $post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );             if($post_thumbnail_url!='')             {                 $post_thumbnail_url = $post_thumbnail_url;             }else             {                 $post_thumbnail_url = get_template_directory_uri().'/img/noimg.jpg';             }             ?>              <img width="60" height="60" alt="" class="