Skip to main content

Posts

Showing posts from August, 2018

Change date format to time ago WordPress

  /* Function which displays your post date in time ago format */ function meks_time_ago ( ) { return human_time_diff ( get_the_time ( 'U' ) , current_time ( 'timestamp' ) ) . ' ' . __ ( 'ago' ) ; }   2 3 4 5 6 7 8 9   <?php if ( have_posts ( ) ) : ?> <?php while ( have_posts ( ) ) : the_post ( ) ; ?> <?php the_title ( ) ; /* post title */ ?> <?php echo meks_time_ago ( ) ; /* post date in time ago format */ ?> <?php the_content ( ) ; /* post content */ ?> <?php endwhille ( ) ; ?> <?php endif ; ?> For More details Read this https://mekshq.com/change-wordpress-date-format-to-time-ago/

Search Product or Post By Custom Fiels

<?php /**  * Extend WordPress search to include custom fields  *  * https://adambalee.com  */ /**  * Join posts and postmeta tables  *  * http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_join  */ function cf_search_join( $join ) {     global $wpdb;     if ( is_search() ) {            $join .=' LEFT JOIN '.$wpdb->postmeta. ' ON '. $wpdb->posts . '.ID = ' . $wpdb->postmeta . '.post_id ';     }     return $join; } add_filter('posts_join', 'cf_search_join' ); /**  * Modify the search query with posts_where  *  * http://codex.wordpress.org/Plugin_API/Filter_Reference/posts_where  */ function cf_search_where( $where ) {     global $pagenow, $wpdb;     if ( is_search() ) {         $where = preg_replace(             "/\(\s*".$wpdb->posts....

How to add Slick Slider multiple

https://codepen.io/vilcu/pen/ZQwdGQ html <section class="regular slider">   <div>     <img src="http://placehold.it/350x300?text=1">   </div>   <div>     <img src="http://placehold.it/350x300?text=2">   </div>   <div>     <img src="http://placehold.it/350x300?text=3">   </div>   <div>     <img src="http://placehold.it/350x300?text=4">   </div>   <div>     <img src="http://placehold.it/350x300?text=5">   </div>   <div>     <img src="http://placehold.it/350x300?text=6">   </div> </section> <section class="center slider">   <div>     <img src="http://placehold.it/350x300?text=1">   </div>   <div>     <img src="http://placehold....