Use menu structure for permalinks

From a SEO perspective this would qualify as double content and you could get penalized by search engines for it unless you specify the right canonical URL or something, but the best practice would be to redirect one of the URL’s to the other. Whichever you consider the most important. To assist you with your … Read more

edit-tags.php in plugin admin menu hides when is the active page

I’ve managed to solve this using Javascript to ‘open’ the menu item when on the edit tags page in the plugin. Relevant plugin PHP file $screen = get_current_screen(); // Check we’re only on the edit-tags page in the plugin if (‘edit-tags’ === $screen->base && ‘subscriber’ === $screen->post_type) { wp_enqueue_script( $this->plugin_slug . ‘-subscriber-edit-tags-script’, plugins_url(‘assets/js/subscriber-edit-tags.js’, __FILE__ ), … Read more

Subpages List Appearing on Every Page

If you want this for pages only, which would makes sense as to what you described this, just wrap the whole bunch of code in if ( is_page() ) { … }. If you were to put this into a function, you could just bail out early. function wpdev_156446_list_parent_page_tree() { if ( ! is_page() ) … Read more

Add a Submenu from Another Submenu in a Custom Theme

It seems that you are adding the menu levels as separate menus: A “Primary menu” containing the items: “HOME”, “DPRK TOURS”, “INTERNATIONAL”, … etc. A “Secondary menu” containing the items: “INTERNATIONAL GROUP TOURS”, “VOLUNTEER PROGRAMS”, … etc. However, most themes support at most two such menu-levels, and some even support only one. So, if you … Read more

Admin menu post type

Yes you can do that. Use function add_menu_page http://codex.wordpress.org/Function_Reference/add_menu_page to add parent “All post types”, then use add_submenu_page http://codex.wordpress.org/Function_Reference/add_submenu_page to add pages to parent page: add_action( ‘admin_menu’, ‘my_custom_menu_page’ ); function my_custom_menu_page() { $slug = ‘all-post’; add_menu_page( ‘All post types’, ‘All post types’, ‘edit_posts’, $slug, ‘__return_true’ ); foreach( array( ‘post’, ‘page’, ‘foo’, ‘bar’ ) as $post_type … Read more

Show Child of Parent Page including all other parents

‘depth’=>-1 will show all the levels (source^): $depth (integer) (optional) How many levels of the hierarchy are to be included where 0 means all. -1 displays links at any depth and arranges them in a single, flat list. Default: 0 So your code will be: <?php if (has_nav_menu( ‘secondary’ )) { wp_nav_menu( array( ‘container’ => … Read more

Trouble posting in Sub-Category

You have created a simple page name News from the Admin and displayed under the Blog Menu. You have to create a page template and use the WordPress loop to display your posts. You can use this code in your page template and select templates when you publish the page. $args = array( ‘post_type’ => … Read more