Category Archives: WordPress

Setting link for wordpress plugin

This tutorial will help you to set the “settings” link to your plugin in plugin list page “../wp-admin/plugins.php”. I added one function “add_settings_link_to_your_plugins” to set the setting link and i called this function using add_filter() method. // Add settings link to your wordpress plugin page function add_settings_link_to_your_plugins($links) { $settings_link = ‘ Settings’; array_unshift($links, $settings_link); return […]

Create WordPress Admin Menu Plugin

I am learing about “How to develop wordpress plugin”. In this tutorial i will give some information about “How to add wordpress plugin menu in admin menu list”. I did it using function and class. I added my sourcecode below. Create [Plugin] Admin Menu Using Class Create [Plugin] Admin Menu Using Function [Without class] Create […]

Custom Pretty URL in WordPress

This tutorial will help to create a pretty customized URL for wordpress post. ‘generate_rewrite_rules’ action is used to create a new URL format and ‘WP_Rewrite’ is WordPress class for managing the rewrite rules that allow you to use Pretty Permalinks feature. Generate Pretty URL add_action(‘admin_init’, ‘flush_rewrite_rules’); add_action(‘generate_rewrite_rules’, ‘custom_pretty_url_rewrite_rules’); function custom_pretty_url_rewrite_rules( $wp_rewrite ) { $new_rules = […]

Random Post In WordPress

Now I learnt in wordperss “How to display random post in home page”. It is very easy. Just we have to add action in “pre_get_posts” tag. I added sourcecode below <?php add_action(‘pre_get_posts’,’bscode_random_post’); function bscode_random_post($query){ if($query->is_home && empty($query->query_vars[‘suppress_filters’])){ $query->set(‘orderby’,’rand’); } } ?>  

WordPress 3.5 New Color Picker

WordPress 3.5 have the default option for color picker. It was cool and reduced my work for color picker. I add the source code to show color picker in your wordpress form of admin section. Add “wp-color-picker” Script and Style Add An Input box Map “wp-color-picker” to “input box” More Options [gad] Add “wp-color-picker” Script […]

WordPress Admin Page Redirected To Homepage

In this wordpress post, i added the sourcecode to redirect the page or denied the permission When the unauthorized user level will try to access the admin section. Using this sourcecode i am allowing administrator and editor to access the admin panel. Otherwise i am redirecting the user to home page. You can modify redirect […]

WordPress Custom Post Type Plugins

This tutorial will help you to create custom post type using register_post_type. register_post_type should only be invoked through the ‘init’ action. <?php /** * Plugin Name: Custom Post * Plugin URI: * Description: Add the custom post type like user * Version: The Plugin’s Version Number, e.g.: 1.0 * Author: Name Of The Plugin Author […]

WordPress have_posts()

WordPress have_posts() functions is used to check the current wordpress query has any data to loop. It will return true If data is available. Otherwise it will return false. Note: We dont need send any arguments for this function. Format 1: It will basic format in wordpress archieve page, category page etc. <?php if ( […]