Posts

Showing posts from March, 2015

How to add a custom post status in wordpress for custom post type or post post type

Image
For add a new custom post status add below code in your theme's function.php or your custom plugin's file <?php function rj_custom_post_status ( ) { register_post_status ( 'hide' , array ( // hide => change with your custom status slug 'label' => _x ( 'Hide' , 'post' ) , // Hide -> change with ur status name 'public' => true ,   'exclude_from_search' =>false, 'show_in_admin_all_list' => false , 'show_in_admin_status_list' => true , 'label_count' => _n_noop ( 'Hide<span class="count">(%s)</span>' , 'Hide<span class="count">(%s)</span>' ) ) ) ; } add_action ( 'init' , 'rj_custom_post_status',10 ) ; ?> For Display custom status on d

How To Register Menus and use in your custom theme In WordPress

Image
WordPress  allows you to create your own custom menus from pages or category items. Using your theme settings you can define where certain menus can appear. For example you can create a menu for all your categories and display this at the top of your page. To  create a menu in WordPress  go to the menu item in the appearance menu. Pick a name for your menu and start adding items to it. When items are on the menu you can drag and drop the menu items to position them. Registering Your Menu To position your newly created menu on your theme you will first need to register a new menu. Copy the following code and paste it in your theme's functions.php page. you can change your menu name or slug whatever you want to set. function register_menu ( ) { register_nav_menu ( 'homepage-footer-menu' , __ ( 'Homepage Footer Menu' ) ) ; } add_action ( 'after_setup_theme' , 'register_menu' ) ; After paste above code and you refresh your wordp