How to make an anchored page in a navigation menu tab

Add this page link in navigation menu with #target_point, example http://example.com/contact#location_map Then add an anchor at somewhere of that page with name=”location_map”. Something like <a name=”location_map”></a> Now when someone clicks on this menu, he’ll be directed to this specific part of contact page.

‘get_previous_post’ in same category returning (!empty) when no previous post in category exists

Figured it out 🙂 It ends up the Smarter Navigation plugin has a few other functions that I missed: https://plugins.trac.wordpress.org/browser/smarter-navigation/trunk/template-tags.php I used get_adjacent_id_smart() like so: <?php $prev_post = get_adjacent_id_smart(true); if(!empty($prev_post)): echo ‘not empty’; previous_post_smart(); else: echo ’empty’; endif; ?> And I got the behavior I was looking for, don’t know why the default WP function … Read more

How to add or remove borders in navigation menu?

With CSS 3, you can use the :last-child or :last-of-type selectors: .is-frontend #content-holder .semplice-navbar nav ul li:last-child { border-right: 1px solid #000000; } However, you could flip this around to make it more backwards compatible using :first-child (which is available in CSS2): .is-frontend #content-holder .semplice-navbar nav ul li { border-left: 1px solid #000000; } .is-frontend … Read more

how to make a walker to this (in bootstrap, i try but not work)

I use this navwalker <?php class wp_bootstrap_navwalker extends Walker_Nav_Menu { public function start_lvl( &$output, $depth = 0, $args = array() ) { $indent = str_repeat( “\t”, $depth ); $output .= “\n$indent<ul role=\”menu\” class=\” dropdown-menu\”>\n”; } public function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) { $indent = ( $depth … Read more

All navigation fails and leads me to homepage

Some more information is welcome. maybe your .htaccess file got messed up? Delete it and, recreate in settings permalinks. deleting .htaccess. use your prefered ftp client and go into your root folder. find a file called .htaccess and delete it. If you can not seem to locate it make sure your settings show ‘hidden’ files. … Read more

get adjacent post by meta key and meta value

The plugin “Ambrosite Next/Previous Post Link Plus” https://wordpress.org/plugins/ambrosite-nextprevious-post-link-plus/ ..seems to do the job well To further style the results, one could even use it like this $prev = previous_post_link_plus( array(‘return’ => ‘id’) ); query_posts(‘p=’.$prev); while (have_posts()) : the_post(); […your stuff here…] endwhile; wp_reset_query(); $next = next_post_link_plus( array(‘return’ => ‘id’) ); query_posts(‘p=’.$next); while (have_posts()) : the_post(); … Read more