Remove Admin Dashboard Widget

function remove_dashboard_widgets(){ global$wp_meta_boxes; unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_plugins']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_recent_comments']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_primary']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_incoming_links']); unset($wp_meta_boxes['dashboard']['normal']['core']['dashboard_right_now']); unset($wp_meta_boxes['dashboard']['side']['core']['dashboard_secondary']); } add_action('wp_dashboard_setup', 'remove_dashboard_widgets'); //Removing Menu Items function remove_menu_items() { global $menu; $restricted = array(__('Links'), __('Media'), ('Plugins'), ('Tools'), __('Users')); end ($menu); while (prev($menu)){ $value = explode(' ',$menu[key($menu)][0]); if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){ unset($menu[key($menu)]);} } } add_action('admin_menu', 'remove_menu_items');

Total Search Result Count

<?php /* Search Count */ $allsearch = &new WP_Query("s=$s&showposts=-1"); $key = wp_specialchars($s, 1); $count = $allsearch->post_count; _e(''); //_e('<span class="search-terms">'); //echo $key; _e('</span>'); //_e(' &mdash; '); //echo $count . ' '; //_e('articles'); wp_reset_query(); ?>   <h6>About </span> <span><?php echo $count; ?> results</span>  ( 0.<span id="speed"></span> seconds )</h6>

Google Like Pagination

function pagination($pages = '', $range = 4) { $showitems = ($range * 2)+1; global $paged; if(empty($paged)) $paged = 1; if($pages == '') { global $wp_query; $pages = $wp_query->max_num_pages; if(!$pages) { $pages = 1; } } if(1 != $pages) { echo ""; //if($paged > 2 && $paged > $range+1 && $showitems « First"; //echo ""; //if($paged... Continue Reading →

Get Page Load Time

window.onload = function () { var loadTime = window.performance.timing.domContentLoadedEventEnd-window.performance.timing.navigationStart; //console.log('Page load time is '+ loadTime); document.getElementById("speed").innerHTML = + loadTime; }   <h6>About </span> <span><?php echo $count; ?> results</span>  ( 0.<span id="speed"></span> seconds )</h6>

Accordian Slider with Custom Post

function tiptrick_shortcode($atts, $content){ extract (shortcode_atts( array( 'posts' => 4, 'category_slug' => "tipstricks-default-category", ), $atts )); global $post; $args=array( 'post_type'=>'tiptrick', 'post_status' => 'publish', 'posts_per_page' => $posts, 'orderby' => 'date', 'order' => 'DESC', 'caller_get_posts'=> 1, 'tiptrick_cat'=> $category_slug, 'tax_query' => array( 'taxonomy' => 'tiptrick_cat', 'field'    => 'slug', 'terms'    => array($category_slug), ) ); $catObj = get_term_by('slug', $category_slug, 'tiptrick_cat'); $catName... Continue Reading →

Search For a Custom Post Type Only

<form role="search" action="<?php echo site_url('/'); ?>" method="get" id="searchform"> <input type="text" name="s" placeholder="Search Portfolio"/> <input type="hidden" name="post_type" value="myportfolio" /> <input type="submit" alt="Search" value="Search" /> </form>

Multi Select Isotope Portfolio

Industry 0 ){ foreach ( $terms as $term ){ echo'slug.'" id="'.$term->slug.'" />slug.'">'.$term->name.''; } } ?> Framework 0 ){ foreach ( $terms as $term ){ echo'slug.'" id="'.$term->slug.'" />slug.'">'.$term->name.''; } } ?> Design 0 ){ foreach ( $terms as $term ){ echo'slug.'" id="'.$term->slug.'" />slug.'">'.$term->name.''; } } ?> </div> -1, 'order'=> 'DESC', 'post_type' => 'myportfolio', 'paged' => $paged);... Continue Reading →

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: