I'm using this function to switch to my main website's navigation and display it on all sub sites in my multisite network. Ideally the links should have the following format: http://www.mysite.com/navigation-link but on the sub-sites the urls are http://www.mysite.com/subsite/navigation-link Obviously these pages don't exist so it's just showing a blank page. Any idea how I could make sure the urls are like the first example and how I might incorporate that into my function? function wp_multisite_nav_menu() { global $blog_id; $args …
I have a Taxonomy that I would like to change the link to in the WP menu. When clicking it goes to the Add Taxonomy page, like normal. What I would like to do is navigate to the Edit Page. In other words, the taxonomy navigates to edit-tags.php (as expected) /wp-admin/edit-tags.php?taxonomy=news_archive_options&post_type=news What I'd like to do is navigate to the term.php page /wp-admin/term.php?taxonomy=news_archive_options&tag_ID=10&post_type=news Thanks!
Question: is there a way for a link to an anchor bookmark to arrive at its destination by loading another page first? I'm developing a vertical-scrolling style website where the home page displays the contents of 3 other pages within sections or divs. Each section has a bookmark and a "back to top" link, and my main navigation menu uses custom bookmark anchor links. I'm also using thejQuery smooth scrolling plugin which works very well. The problem I'd like to …
so im building a custom theme and ive got stuck on the navigation if i use wp_head(); it loads bootstrap and my custom style sheet but not the navigation if i use get_header(); it loads the navigation but not bootstrap or my custom style sheet here is my functions.php function register_navwalker(){ require_once get_template_directory() . '/inc/class-wp-bootstrap-navwalker.php'; } add_action( 'after_setup_theme', 'register_navwalker' ); function wpbootstrap_enqueue_styles() { wp_enqueue_style( 'bootstrap', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css' ); wp_enqueue_style( 'my-style', get_template_directory_uri() . '/style.css'); wp_enqueue_script('bootstrap-js', 'https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js', array('jquery'), NULL, true); } add_action('wp_enqueue_scripts', 'wpbootstrap_enqueue_styles'); …
I am creating a custom nav walker but having trouble outputting parent menu item title in start_lvl function. I want to output it right after the <div class="dropdown"> in the following start_lvl function. function start_lvl(&$output, $depth = 0, $args = array()) { $indent = str_repeat("\t", $depth); if ($depth == 0) { $out_div = ' <div class="dropdown-wrapper"><div class="dropdown">This is where I want to output parent item title'; } else { $out_div = ''; } // build html $output.= "\n" . $indent …
I'm calling wp_nav_menu programmatically on a class and I'd like to be able to set the field that will be shown as the current-menu-item but I don't see an argument for that. It seems like I may be able to use nav_menu_css_class?
I'm working on something someone else set up, and on the index page, the nav appears, but on custom post type pages, it does not. The nav menu: wp_nav_menu([ 'menu' => 'Primary Menu', 'theme_location' => 'primary', 'depth' => 3, 'container' => 'div', 'container_class' => 'a', 'container_id' => 'b', 'menu_class' => 'nav navbar-nav', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 'walker' => new wp_bootstrap_navwalker() ]); I've seen it suggested that I place this in a function and use an if statement to do something and …
Recently, my site started showing two navigation bars at the top of my page. They are also the wrong layout. I am fairly new to WordPress. I have only designed five websites so far. This is the first time I have encountered this issue. I am editing through Elementor Pro, and this does not show up when I preview the page, but it shows up when you enter into the website itself. How can this be fixed?
I have read the following post which appears to solve my problem but doesn't... excluded_categories parameter in next_post_link() behaving unexpectedly I have posts in say 3 categories but if they are included in category 'update' (which is ID 96) I would like them excluded from the previous / next navigation system. From the above post I have edited the following code (this is all in my functions.php file as the single.php template calls for the navigation from there). <?php previous_post_link( …
I'm working on a theme with custom menus, currently using WP 4.0.1. I'm registering two menus in functions.php: register_nav_menus( array( 'primary' => __( 'Main Menu', 'wsy' ), 'secondary' => __( 'Secondary Menu', 'wsy' ) ) ); Then, displaying them in my header.php file: <nav role="navigation"> <?php wp_nav_menu( array( 'theme_location' => 'primary', 'depth' => '1' ) ); ?> </nav> The problem is, when I select a specific menu from either the Menus page or the customizer, they stop showing up in …
Wordpress nav menu created by wp_nav_menu can highlight current menu item. How can i strip anchor from current menu item? For example, we have menu: <ul> <li class="current-menu-item"><a href="/somelink">Home</a></li> <li><a href="/elselink">Item</a></li> ... </ul> Can we remove <a href="/somelink"> and leave just "Home" if it is current page? UPD. In my functions.php I have a walker like this: class My_Walker_Nav_Menu extends Walker_Nav_Menu { function start_lvl(&$output, $depth) { $indent = str_repeat("\t", $depth); $output .= "\n$indent<ul class=\"dropdown-menu\">\n"; } } and I've found the …
You see I have a Navigation bar items, in the parent item Products & Services with two sub menus. I have a requirement, when I click the menu item Products & Services it redirect to its sub-menu Dedicated Servers. How can I do with this? EDIT-01 I only want the Products & Services parent have this redirect, the other parent do not need, such as Home, Advantage they all have their own page.
I am using wordpress and all I want to do is make the URL appear in the form where, Blogs is mentioned and then the blogname. But I want this structure only when someone visits blogs page. The blogs slug shouldn't appear elsewhere like if i go another page, then the blogs shouldn't be shown. The structure I am desiring should only appear when someone is accessing blogs pages. For Ex: www.example.com/blogs/blogname - That's it! NO CATEGORY, NO NOTHING. ONLY …
I'm having a weird issue. I have 2 menus, and registered them in functions.php, like this: add_theme_support( 'menus' ); register_nav_menu( 'primary', 'Top Nav' ); register_nav_menu( 'footer', 'Footer' ); In my header, I have the following code <?php wp_nav_menu(array( 'menu' => 'Top Nav', 'theme_location' => 'primary', 'depth' => 2, 'container' => 'div', 'container_class' => 'navbar-collapse collapse', 'menu_class' => 'nav navbar-nav navbar-right', 'fallback_cb' => 'wp_bootstrap_navwalker::fallback', 'walker' => new wp_bootstrap_navwalker() )); ?> However, the header always display the other menu, assigned to footer, …
I have a custom post type with this structure: First Parent 1st child of First Parent 2ndchild of First Parent 3rd child of First Parent Second Parent 1st child of Second Parent 2nd child of Second Parent 3rd child of Second Parent I'm trying to make previous_post_link() and next_post_link() to work that when you are in the First Parent, the next_post_link() will go to the 1st child of First Parent and then when you are in the 1st child of …
I have a website with WordPress and I want to load a specific category when the page loads. I have not tried it. Will it create problems or error if I change it.
I need a way to link to the first and the last post (CPT) created. For example, I'm in the last post and if I click in "next" I should go to the first. Now i have this <?php $next_post = get_next_post(); if ( ! empty( $next_post ) ) : ?> <div id="nextpost" > <a href="<?php echo get_permalink( $next_post->ID ); ?>"> <!-- <?php echo get_the_post_thumbnail( $next_post->ID, 'thumbnail' ); ?> --> </a> <span class="nav-next"> <?php next_post_link( '%link', __( 'Next project', 'twentyeleven' …
I want to render the WordPress posts pagination markup with my own HTML markup. My theme has a pagination markup with ul > li format. But the WordPress default pagination markup is different than my markup. How can I apply my own HTML markup instead of the default pagination markup?
Can anyone give me a clue how this menu system was created? https://40thdems.org/ This is a WordPress site using the Divi theme. Thanks in advance for any pointers!