Articles of navigation

Can the_post_navigation() be outside of the loop?

I am wondering if the_post_navigation() function will work properly outside the loop in single views. For example: while ( have_posts() ) : the_post(); get_template_part( ‘template-parts/content’, ‘single’ ); endwhile; the_post_navigation();

Header lists posts instead of showing primary nav menu

I recently began experimenting with WordPress Multisite and I’m running into an issue with the primary navigation menu. Instead of showing the items in the menu that’s registered as the primary menu, it just lists around 20 pages. I’m using the same theme as the master site on the network and I’ve copied some of […]

Setting Active Nav item (of Pages) when you are on a Post with Category

I am working on my first WordPress custom theme and I now have a problem. I’ve organized the site such that I’m using a front-page.php as my home page that shows a long page with some links. These links go to other Pages. Let’s call these T1s. On those pages, I have a long page […]

Get primary theme locations and assign menu

I have created a simple plugin. I use it on freshly installed wordpress. It is creating navigation menu with one page programmatically. However I cannot assign this navigation to whatever primary current theme location has to offer. add_action(‘wp_meta’, ‘navigation_process’); // To check if a menu exists first and then create it if it doesn’t exists […]

WordPress Network Wide Menu stopped working after change domain

We’ve been using WordPress Network Wide Menu Plugin for our multisite Intranet environment for quite some time. It works great to share the same top main navigation across all sub-sites. We recently created a development environment by refreshing the database from production to development environment in order to create an identical environment (we only change […]

How to achieve this navigation style in wordpress navigation

I was wondering how to achieve this navigation style in WordPress. The menu structure is like this — <ul> <li> <a href=”index.php”> Home <span> MAIN PAGE </span> </a> </li> </ul>

Navigation bar top / bottom border issue

I’m attempting to create a navigation bar with the my pages and categories. I got it to work with the php codes, but I’m having trouble getting the top and bottom border to show up. On my old HTML side, I just did this code which showed up great: ul { padding: 10px 0 10px […]

How to select particular menu position in wordpress?

I have 3 menu positions primary, side and footer in functions.php. ho do i select side menu position and add condition to that menu only? function abc_menus() { register_nav_menus( array( ‘primary’ => __( ‘Primary Menu’ ),//Main Menu ‘side’=>__(‘Our Holidays’),//Menu on side ‘footer’=>__(‘Footer ‘),//First Footer Menu ) ); } add_action( ‘after_setup_theme’, ‘abc_menus’ );

Adding the last page to the beginning and first page to the end of a next and previous pages links function

I have a function that grabs the next and previous child pages. works perfectly, but I would like it to grab the last child page if we’re on the first and the first child page if we’re on the last. The function: // function to find location within array function relative_value_array($array, $current_val = ”, $offset […]

Next previous post of two custom taxonomies

I am building educational site. I am using 2 custom taxonomies for post. Suppose one for classes and another for subject. Now I want that when visitor surf 12th class physics subject topic, I want the next post link from same taxonomies. Means next post of 12th class and physics subject.