Now days there are near about 38000+ plugins including premium and free for WordPress . But this is not necessary to use plugins every time . There are a couple of things you can do without use of plugin . Today i am going to discuss 10 WordPress tricks you can do without plugin.

1) Register new side bar: WordPress side bar plays a very nice role in your blog to show latest post , menu items ads and many more . You can register new side bar in the WordPress. you just need to write some lines of code in your functions.php . that will do the job.

function mycustomsidebarinit() {
register_sidebar( array(
		'name'          => __( 'custom Widget Area', 'mytheme' ),
		'id'            => 'sidebar-10',
		'description'   => __( 'Appears in the footer section of the site.', 'twentythirteen' ),
		'before_widget' => '
<aside id="%1$s" class="widget %2$s">',
		'after_widget'  => '</aside>

',
		'before_title'  => '
<h3 class="widget-title">',
		'after_title'   => '</h3>

',
) );
add_action( 'widgets_init', 'mycustomsidebarinit' );

these lines will add a widget area in WordPress admin .
2) Register a new menu:

function mytheme_setup() {
	// This theme uses wp_nav_menu() in one location.
	register_nav_menu( 'secondary', __( 'footerMenu', 'mytheme' ) );
}
add_action( 'after_setup_theme', 'mytheme_setup' );

3) set default thumbnail size:Thumbnails reduces the page load time so we should use thumbnails at place of full image in WordPress we can change the default thumbnail size . like this

function mytheme_setup() {
	add_theme_support( 'post-thumbnails' );
	set_post_thumbnail_size( 604, 270, true );
}
add_action( 'after_setup_theme', 'mytheme_setup' );

4) Register custom post type Custom post type is a very nice feature of wordpress . Same like wordpress posts we can create custom posts with a different menu name and different post type . I have written an article on this recently . you can check this How to add wordpress custom post type with category

add_action( 'init', 'codingbin_blogs_init' );
/**
 * Register a blog post type.
 *
 * @link http://codex.wordpress.org/Function_Reference/register_post_type
 */
function codingbin_blogs_init() {
 $labels = array(
 'name' => _x( 'Blogs', 'post type general name', 'your-plugin-textdomain' ),
 'singular_name' => _x( 'Blog', 'post type singular name', 'your-plugin-textdomain' ),
 'menu_name' =>_x( 'Blogs', 'admin menu', 'your-plugin-textdomain' ),
 'name_admin_bar' => _x( 'Blog', 'add new on admin bar', 'your-plugin-textdomain' ),
 'add_new' => _x( 'Add New', 'book', 'your-plugin-textdomain' ),
 'add_new_item' => __( 'Add New Blog', 'your-plugin-textdomain' ),
 'new_item' => __( 'New Blog', 'your-plugin-textdomain' ),
 'edit_item' => __( 'Edit Blog', 'your-plugin-textdomain' ),
 'view_item' => __( 'View Blog', 'your-plugin-textdomain' ),
 'all_items' => __( 'All Blog', 'your-plugin-textdomain' ),
 'search_items' => __( 'Search Blog', 'your-plugin-textdomain' ),
 'parent_item_colon' => __( 'Parent Blog:', 'your-plugin-textdomain' ),
 'not_found' => __( 'No Blogs found.', 'your-plugin-textdomain' ),
 'not_found_in_trash' => __( 'No Blogs found in Trash.', 'your-plugin-textdomain' )
 );
 
 $args = array(
 'labels' => $labels,
 'public' => true,
 'publicly_queryable' => true,
 'show_ui' => true,
 'show_in_menu' => true,
 'query_var' => true,
 'rewrite' => array( 'slug' =&gt; 'blog' ),
 'capability_type' => 'post',
 'has_archive' => true,
 'hierarchical' => false,
 'menu_position' => null,
 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'comments' ) // 
 );
 
 register_post_type( 'blog', $args );
}

5) Hide wordpress admin bar:Don’t want to display wordpress admin bar to normal user ? No issue . You don’t need to use plugin for this . Some lines of code can do this job for you . check below

//disable for simple user
add_action('after_setup_theme', 'remove_admin_bar');

function remove_admin_bar() {
if (!current_user_can('administrator') && !is_admin()) {
  show_admin_bar(false);
}
}

/* Disable WordPress Admin Bar for all users but admins. */
  show_admin_bar(false);

6) Restrict Wp-admin access: Some people use a plugin to restrict the wordpress dashboard for simple users . But a simple code can do this job . Check it out

add_action( 'init', 'blockusers_init' );
 
function blockusers_init() {
 if ( is_admin() && ! current_user_can( 'administrator' ) && 
 ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
 wp_redirect( home_url() );
 exit;
 }
}

7)Change excerpts length:For some scenarios, the default excerpts don’t fit the layout, so you need to change it accordingly.The default excerpts length is 55 words If that’s what you need, with your functions.php file opened, copy in it the following code:

function custom_excerpt_length( $length ) {
  return 10;
}
add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

8) Exclude categories from search :If you want to exclude some of your post categories from the WordPress search result then use the given code

function SearchFilter($query) {
  if ( $query->is_search && ! is_admin() ) {
    $query->set('cat','8,15'); 
  }
  return $query; 
}
add_filter('pre_get_posts','SearchFilter');

9) Add numbered pagination: Many people use a plugin to do this job . I have written an articles on this please check it out here for full detail How to add numbered pagination

function codingbin_paginate_links($args = '') {
    $defaults = array(
        'base' => '%_%', // http://example.com/all_posts.php%_% : %_% is replaced by format (below)
        'format' => '?page=%#%', // ?page=%#% : %#% is replaced by the page number
        'total' => 1,
        'current' => 0,
        'show_all' => false,
        'prev_next' => true,
        'prev_text' => __('&laquo; Previous'),
        'next_text' => __('Next &raquo;'),
        'end_size' => 1,
        'mid_size' => 2,
        'type' => 'plain',
        'add_args' => false, // array of query args to add
        'add_fragment' => '',
        'before_page_number' => '',
        'after_page_number' => ''
    );
    $args = wp_parse_args($args, $defaults);
    extract($args, EXTR_SKIP);
    // Who knows what else people pass in $args
    $total = (int) $total;
    if ($total < 2)
        return;
    $current = (int) $current;
    $end_size = 0 < (int) $end_size ? (int) $end_size : 1; // Out of bounds? Make it the default.
    $mid_size = 0 <= (int) $mid_size ? (int) $mid_size : 2;
    $add_args = is_array($add_args) ? $add_args : false;
    $r = '';
    $page_links = array();
    $n = 0;
    $dots = false;
    $prev_link = '

<span class="prev-click">prev</span>

';
    if ($prev_next && $current && 1 < $current):
        $link = str_replace('%_%', 2 == $current ? '' : $format, $base);
    $link = str_replace('%#%', $current - 1, $link);
    if ($add_args)
        $link = add_query_arg($add_args, $link);
         
    $link.= $add_fragment;
    /**
     * Filter the paginated links for the given archive pages.
     *
     * @since 3.0.0
     *
     * @param string $link The paginated link URL.
     */
    $prev_link = '<a class="prev-div" href="'.esc_url(apply_filters('paginate_links', $link)). '">prev</a>';
    endif;
    for ($n = 1; $n <= $total; $n++):
        if ($n == $current):
            $page_links[] = "
<h3 class='page-numbers'>".$before_page_number.number_format_i18n($n).$after_page_number.
        "</h3>

";
    $dots = true;
    else :
        if ($show_all || ($n <= $end_size || ($current && $n >= $current - $mid_size && $n <= $current + $mid_size) || $n > $total - $end_size)):
            $link = str_replace('%_%', 1 == $n ? '' : $format, $base);
    $link = str_replace('%#%', $n, $link);
    if ($add_args)
        $link = add_query_arg($add_args, $link);
    $link.= $add_fragment;
    /** This filter is documented in wp-includes/general-template.php */
    $page_links[] = "<a class='page-numbers' href='".esc_url(apply_filters('paginate_links', $link)). "'>".$before_page_number.number_format_i18n($n).$after_page_number.
    "</a>";
    $dots = true;
    elseif($dots && !$show_all):
        $page_links[] = '<span class="page-numbers dots">'.__('&hellip;').
    '</span>';
    $dots = false;
    endif;
    endif;
    endfor;
    $next_link = '

next

';
    if ($prev_next && $current && ($current < $total || -1 == $total)):
        $link = str_replace('%_%', $format, $base);
    $link = str_replace('%#%', $current + 1, $link);
    if ($add_args)
        $link = add_query_arg($add_args, $link);
    $link.= $add_fragment;
    /** This filter is documented in wp-includes/general-template.php */
    //$page_links[] = '<a class="next page-numbers" href="' . esc_url( apply_filters( 'paginate_links', $link ) ) . '">' . $next_text . '</a>';
    $next_link = '<a class="next-div" href="'.esc_url(apply_filters('paginate_links', $link)). '">next</a>';
    endif;
    switch ($type):
    case 'array':
        return $page_links;
        break;
    case 'list':
        $r.= '
<div class="pagination">';
        $r.= $prev_link;
        $r.= "
<ul class='page-numbers'>\n\t
<li>";
        $r.= join("</li>

\n\t
<li>", $page_links);
        $r.= "</li>

\n</ul>

\n";
        $r.= $next_link;
        $r.= '
<div class="clear"></div>
</div>

';
        break;
    default:
        $r = join("\n", $page_links);
        break;
        endswitch;
        return $r;
}
read this article for full <a href="http://codingbin.com/wordpress-number-pagination-without-plugin/" target="_blank">reference </a>

10) Replace Howdy:I personally don’t like this on my wordpress dashboard. this is too informal and many from us wants to replace with a better message . Following code will replace “Howdy” with “Welcome” check it out .

function replace_howdy( $wp_admin_bar ) {
    $my_account=$wp_admin_bar->get_node('my-account');
    $newtitle = str_replace( 'Howdy,', 'Welcome', $my_account->title );
    $wp_admin_bar->add_node( array(
        'id' => 'my-account',
        'title' => $newtitle,
    ) );
}
add_filter( 'admin_bar_menu', 'replace_howdy',25 );
http://codingbin.com/wp-content/uploads/2016/01/wordpress-tricks-hacks.jpghttp://codingbin.com/wp-content/uploads/2016/01/wordpress-tricks-hacks-150x150.jpgdevidcmsWordPressNow days there are near about 38000+ plugins including premium and free for WordPress . But this is not necessary to use plugins every time . There are a couple of things you can do without use of plugin . Today i am going to discuss 10 WordPress tricks...coding, php, wordpress, yii, cakephp, and  jquery

Are you want to get implementation help, or modify or extend the functionality of this script? Submit paid service request