How to get top parent page ID in wordpress
The solution to get the top parent page id is here, it is quite easy without using any recursion function. function get_top_parent_page_id() { global $post; // Check if page is a child page (any...
The solution to get the top parent page id is here, it is quite easy without using any recursion function. function get_top_parent_page_id() { global $post; // Check if page is a child page (any...
Remove links from wordpress admin bar: Given below code remove the wordpress logo and other links from the admin bar. function annointed_admin_bar_remove() { global $wp_admin_bar; /* Remove their stuff */ $wp_admin_bar->remove_menu(‘wp-logo’); $wp_admin_bar->remove_menu(‘updates’); $wp_admin_bar->remove_menu(‘view-site’); $wp_admin_bar->remove_menu(‘new-link’);...
Remove menu page links: function remove_menus() { global $submenu; remove_menu_page( ‘link-manager.php’ ); // Links remove_menu_page( ‘edit-comments.php’ ); // Comments remove_menu_page( ‘themes.php’ ); // Appearance remove_menu_page( ‘plugins.php’ ); // Plugins remove_menu_page( ‘users.php’ ); // Users...
The following example will show the categories with checkbox <?php $args=array( ‘child_of’ => ‘1’, ‘hide_empty’ => ‘0’ ); $categories = get_categories($args); foreach($categories as $key => $value){ ?> <label><input name=”escorts_category[]” value=”<?php echo $categories[$key]->cat_ID; ?>” type=”checkbox”>...
we have several ways to add custom post type counts to the dashboard including right_now_content_table_end. For Example: function add_area_counts() { if (!post_type_exists(‘escorts’)) { return; } $num_posts = wp_count_posts( ‘escorts’ ); $num = number_format_i18n( $num_posts->publish...
Copy and paste the given blow code in your theme functions.php file which will change the length of the wordpress excerpt function. function ratanjyot_solutions_excerpt_length($length) { return 50; } add_filter(‘excerpt_length’, ‘ratanjyot_solutions_excerpt_length’); The above code set...