current-post-parent for custom post type
current-post-parent for custom post type
current-post-parent for custom post type
Do you want the same image for each menu item? .menu-item a:before { content: url(“/path/to/image.png”); display: inline-block; } The menu items should already have an ID on each <li> li#menu-item-274 a:before { content: url(“/path/to/another/image.png”); } Failing that, you can implement your own Bootstrap Navwalker and add whatever classes or images you like. See: https://developer.wordpress.org/reference/classes/walker/ and … Read more
Change markup for just 2nd list element in custom Walker menu
WP Bootstrap Nav (not JS, not missing ID)
Here are a couple things I noticed. You don’t want to include the <a> inside of link_before or link_after, you will get 2 links if you do that. You also don’t need the <ul>. Instead I think you want something like this… <?php wp_nav_menu(array( ‘theme_location’ => ‘primary’, ‘before’ => ‘<class=”nav-item active”>’, ‘menu_class’ =>’navbar-nav mr-auto’, ‘link_before’ … Read more
wp_nav_menu() is the correct function to display a menu. Is the default menu assigned to the location you’ve specified and if so, are there any items assigned to that menu? Menus without any items assign will display pages by default. You could try adding the menu param with a value of the name of your … Read more
You’re using previous_posts_link (and next_posts_link) function in your code. This function prints a link to the previous set of posts within the current query. So they are meant for posts archives. But if you’re on single page/post, so there is only one post in the query – the one that is shown. So these links … Read more
Warning: sprintf(): Too few arguments in nav-menu-template.php
You can add a menu item whose link goes to a specific section on the same page or a section on a different page. This works with any WordPress menu, which you can create and edit by clicking Appearance > Menus in the WordPress admin panel. This technique involves two steps: adding a unique ID … Read more
Change URL of previous posts and next posts link in WordPress