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 →

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>

Ajax Search Form

jQuery(document).ready(function() {jQuery jQuery('#schoolword').on('input', function() { var searchKeyword = jQuery(this).val(); var searchType = jQuery('#searchby').val(); if (searchKeyword.length >= 3) { jQuery.post('/includes/schoolsearch-ajax.php', { keywords: searchKeyword,searchtype: searchType }, function(data) { jQuery('ul#schoollist').empty() jQuery.each(data, function() {jQuery('ul#schoollist').append('<li>//<a href="//'+this.link+'">' + this.t//itle + '</a></li//>');   '); }); }, 'json'); } }); }); Search Form " value="" name="s" /> ajax-search.php <?php require_once('../../../wp-load.php'); global $wpdb; if... Continue Reading →

jQuery-php-ajax Calling

jQuery(document).ready(function(){ jQuery('#pfilter li').css('cursor', 'pointer'); jQuery("#pfilter li").click(function(){ jQuery('#spinner').show(); jQuery('#spinner').html('/images/oudarya2.GIF" alt="Loading..."/>'); var slug = jQuery(this).attr('id'); jQuery.ajax({ url: "/filter-product.php", type: 'POST', data: 'slg=' +slug, success: function(data) { jQuery('#spinner').hide(); jQuery("#prd").html(data); } }); }); }); In HTML : <?php $level = get_queried_object()->term_id; //echo $level; $parent_id = $level; $termchildren = get_terms('product_cat',array('child_of' => $parent_id)); echo '<ul id="pfilter" class="sidemenu">'; foreach($termchildren as $sub_category) {... Continue Reading →

Create a free website or blog at WordPress.com.

Up ↑

%d bloggers like this: