Conditional Nav Menu Inside Nav Menu Across Multisite Sites
Conditional Nav Menu Inside Nav Menu Across Multisite Sites
Conditional Nav Menu Inside Nav Menu Across Multisite Sites
If you take a look at the link generated by the <!–nextpage–> tag, it just appends /2 for page 2 /3 for page 3 and so on. In other words, it adds a query string page=page_number to your post link. So all you have to do is insert an hyperlink to your image with the … Read more
You have a script active that prevents normal behaviour of links if they have no target=”_blank” attribute on them. The original site has this attribute on the link to the blog, so that one works. The ‘new’ site doesn’t have it on the menu links, so those links are disabled. To fix this, go to … Read more
This has little to do with WordPress, but anyway, in your template you can grab the directory structure with scandir: $report_files = scandir(‘/reports’); Now you have array of files and folders that you can manipulate ate will.
This code will check to ensure that the theme_location is header. Also, menu is the parameter where the desired WordPress Nav menu is specified. menu_id is the HTML ID that is applied to the <ul> element which forms the menu. Docs on the arguments for wp_nav_menu() can be found here. add_filter( ‘wp_nav_menu_args’, ‘bb_wp_nav_menu_args’ ); function … Read more
Since it’s not clear exactly what you need it’s hard to give you the best solution. However … You should be able to use get_next_posts_link() in your loop template. Or get_previous_posts_link() if that’s what you want. If that returns null you can then echo a link to whereever you want in your template. if(!get_next_posts_link()) { … Read more
I think you should use wp_link_pages function, it’s was built for that purpose. $defaults = array( ‘before’ => ‘<p>’ . __( ‘Pages:’ ), ‘after’ => ‘</p>’, ‘link_before’ => ”, ‘link_after’ => ”, ‘next_or_number’ => ‘number’, ‘separator’ => ‘ ‘, ‘nextpagelink’ => __( ‘Next page’ ), ‘previouspagelink’ => __( ‘Previous page’ ), ‘pagelink’ => ‘%’, ‘echo’ … Read more
Yes, the_post_navigation() works outside of the loop on single post views. Following the function calls, the_post_navigation() uses get_the_post_navigation() which uses get_previous_post_link() and get_next_post_link() which use get_adjacent_post_link() which finally uses get_post() which defaults to the global $post object. Here’s an excerpt of get_adjacent_post_link(): function get_adjacent_post_link( $format, $link, $in_same_term = false, $excluded_terms=””, $previous = true, $taxonomy = … Read more
Well, once I got debugging working, I was able to figure out how this nav_menu_css_class filter works. First, I parse the url off of the nav item. Then I use that to compare against the post’s category array. If I find a match, I set the $classes[] array, and I’m good to go. I know … Read more
Thanks to help from @Milo, I was able to figure it out. It had to do with the ‘theme_location’ => ‘main_nav_primary’ line in the wp_nav_menu function call in the header. In functions.php, the primary menu was just registered as primary so I had to change the function call to ‘theme_location’ => ‘primary’. I find it … Read more