Redirect Any Of The Admin Pages To Any Location

The following snippet will let you redirect any of the admin pages to any location you wish based on the user ‘capability’. function wps_redirect_page() { global $pagenow; $pages = array( 'edit-tags.php?taxonomy=category', 'edit-tags.php?taxonomy=post_tag', 'link-manager.php', 'options-writing.php', 'options-reading.php', 'options-discussion.php', 'options-media.php', 'options-privacy.php', 'options-permalink.php', ); if(in_array($newpage,...

Profile photo of mrs.shoma
mrs.shoma
November 21, 2012


READ MORE  

How To Exclude Pgaes From Admin Edit Pages List By ID

Adding this snippet to the functions.php of your wordpress theme will let you remove pages from the admin pages list. Just update the list of page IDs within the array. This is a great little snippet that will exclude pages based on the the ID. add_action( 'pre_get_posts' ,'exclude_this_page'...

Profile photo of mrs.shoma
mrs.shoma
November 21, 2012


READ MORE  

Getting list of tags for a post

get_the_tags function Returns an array of objects, one object for each tag assigned to the post. This tag must be used within The Loop if no parameter used. It take a parameter post id ( numeric, optional). If  post id used then it will work for that post id or it will get current post id. This function...

Profile photo of WP Eden
WP Eden
February 7, 2012


READ MORE  

Create wordpress pricing table in a easier way

So, You or your client selling something  which has diff package packed with different version. Yes, you certainly need a pricing table and if you are already using wordpress then here is the good news for you, Your WordPress Pricing Table designing problem is solved. Here now I shall explain a solution...

Profile photo of WP Eden
WP Eden
December 4, 2011


READ MORE  

How to get logged in users role in wordpress?

Use following function to get user role: function get_user_role($id=null){ global $current_user; if(!$id) $id = $current_user->ID; if ( is_user_logged_in() ) { $user = new WP_User( $id ); if ( !empty( $user->roles ) && is_array( $user->roles ) ) { foreach ( $user->roles as...

Profile photo of Hexagon
Hexagon
August 12, 2011


READ MORE  

How to sort posts of a category using custom fields value in wordpress?

The following query to sort posts using custom field value under a category of custom post type in wordpress: $querystr = " SELECT * FROM $wpdb->posts LEFT JOIN $wpdb->postmeta ON($wpdb->posts.ID = $wpdb->postmeta.post_id) LEFT JOIN $wpdb->term_relationships ON($wpdb->posts.ID...

Profile photo of WP Eden
WP Eden
August 10, 2011


READ MORE  

How to create WordPress custom page template?

It is very easy to create custom page template for WordPress. Go through the following steps to create custom page template in few moments: Create a copy of single.php or page.php lets name it "my-first-page-template.php" Update/Change it as per your need At the top of the my-first-page-template.php...

Profile photo of WP Eden
WP Eden
August 10, 2011


READ MORE  
home