Wordpress Tips Tutorials

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 url When access the admin panel. I allowed administrator and editor to access the admin section […]... Read More »

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 StyleAdd An Input boxMap “wp-color-picker” to “input box”More OptionsAdd “wp-color-picker” Script and Style <?php add_action( 'admin_enqueue_scripts', 'bsc_enqueue_color_picker' ); function bsc_enqueue_color_picker( $hooksuffix ) { /** for color picker **/ wp_enqueue_style( 'wp-color-picker' ); wp_enqueue_script( […]... Read More »

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'); } } ?>... Read More »