Particular Category Archive Widgets & Page

Today i post how to show particular category archive Widgets and archive page. for that we will need to add some code in function.php and archiver.php function.php add_filter( ‘getarchives_join’ , ‘getarchives_join_filter’); function getarchives_join_filter( $join ) { global $wpdb; return $join . ” INNER JOIN {$wpdb->term_relationships} tr ON ($wpdb->posts.ID = tr.object_id) INNER JOIN {$wpdb->term_taxonomy} tt ON […]

How to remove ID and class from menu

Ref wordpress out put will be like contac Us if you want to add any class then add in function.php add_filter(‘nav_menu_css_class’, ‘my_css_attributes_filter’, 50, 1); add_filter(‘nav_menu_item_id’, ‘my_css_attributes_filter’, 50, 1); add_filter(‘page_css_class’, ‘my_css_attributes_filter’, 50, 1); function my_css_attributes_filter($var) { return is_array($var) ? array_intersect($var, array(‘current-menu-item’)) : ”; } output will be like Blog Media(active page) Payment

how to show post views without plugins

add bellow code in function.php file function getPostViews($postID){ $count_key = ‘post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){ delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, ‘1’); return “1”; } return $count.”; } function setPostViews($postID) { $count_key = ‘post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){ $count = 0; delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, ‘1’); }else{ $count++; update_post_meta($postID, $count_key, $count); } } […]