Posts

Showing posts from December, 2014

How to Add Pagination in Your Custom Template

1.Add following codes in your page template before starting posts query.  $args = array(                 'post_type'  => 'post',                 'meta_key' => '_thumbnail_id',                 'posts_per_page' => 7,                 'paged' => $paged);             $query = new WP_Query($args); 2.After end of While loop and before close of IF statement paste following code. echo '     <div id="wp_pagination">         <a class="first page button" href="'.get_pagenum_link(1).'">&laquo;</a>         <a class="previous page button" href="'.get_pagenum_link(($curpage-1 > 0 ? $curpage-1 : 1)).'">&lsaquo;</a>';         for($i=1;$i<=$query->max_num_pages;$i++)             echo '<a class="'.($i == $curpage ? 'active ' : '').'page button" href="'.get_p

How to reduce excerpt Length and remove dots with Readmore link in Wordpress

1.Go to your functions.php file and paste following code. <?php function change_excerpt_length($length) {     return 10 ; } add_filter('excerpt_length', 'change_excerpt_length'); function new_excerpt_more( $more ) {     return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __(' Read More ', 'http://your_domain/') . '</a>'; } add_filter('excerpt_more', 'new_excerpt_more'); ?> Thanks

Add Custom Widget Area in Wordpress

First you’ll want to add this code to your active theme’s function.php file. This code is used to register the custom widget area and create it on the backend. // Custom widget area.   register_sidebar( array (      'name' => __( 'Custom Widget Area' ),      'id' => 'custom-widget-area' ,      'description' => __( 'An optional custom widget area for your site' , 'twentyten' ),      'before_widget' => '<li id="%1$s" class="widget-container %2$s">' ,      'after_widget' => "</li>" ,      'before_title' => '<h3 class="widget-title">' ,      'after_title' => '</h3>' , ) ); Next you’ll want to add this code to whichever page template you’d like the widget area to show up on. This code is used to display the custom widget area in any locatio

Angular JS Directives

There are following Directives in Angular Js . ng-app directives initializes an angular application. ng-init initialize a application data. ng-model binds the value of html controls(button,text) to application data. ng-bind  display application data