Hello Everyone! if you are planing to add your custom menu from anywhere in post,then add this code in your theme function file. /* Custom code for call menu any where [menu name="Site-Map"]*/ function print_menu_shortcode($atts, $content = null) { extract(shortcode_atts(array( 'name' => null, ), $atts)); return wp_nav_menu( array( 'menu' => $name, 'echo' => false )
Hello Everyone, If you are trying to remove “category” base from url without any plugin then use my this code URL Before Add this code like https://www.wp-experts.in/blog/category/wordpress/ URL After Add this code in your theme function like this https://www.wp-experts.in/blog/wordpress/ ———————————————————————————————————— /* Remove category base usign hooks */ register_activation_hook(__FILE__, 'raghunath_category_base_refresh_rules'); register_deactivation_hook(__FILE__, 'raghunath_category_base_deactivate'); /* actions */ add_action('created_category',
Hello Everyone! If you want hide the view button for custom post type then you can use this code. The following code will remove the edit permalink and view post button from your edit/add custom post type screens. In this example I have allowed for three different CPTs to be targeted but you can adjust
Hello Everyone If you are trying to add pagination on for your custom post type using “WP-PageNavi” plugin in your site then you have need to add custom post type query in wp_pagenavi() function after end of while loop <?php $paged = get_query_var('paged') ? get_query_var('paged') : 1; $loop = new WP_Query( array( 'post_type'
Hello Everyone, If you want reterieve a category list any where in your theme page then use this code <ul> <?php wp_list_categories('orderby=name&include=3,5,9,16'); //here 3,5,9,16 is the category id,so you can change this according your requirement ?> </ul> Please have a look on on this link http://codex.wordpress.org/Template_Tags/wp_list_categories for more option Enjoy Code!