the_post_navigation seems to ignore same category filter

You mention a custom post type, are you also using a custom taxonomy? If so you need to specify this taxonomy in your function call: the_post_navigation(array( ‘prev_text’=>__(‘previous project: %title’), ‘next_text’=>__(‘next project: %title’), ‘in_same_term’ => true, ‘taxonomy’ => ‘wpse240053_custom_taxonomy_name’, )); By default the built-in category taxonomy for Posts is used. This requires WP4.4 or later.

Return only top-level navigation items from a menu using wp_get_nav_menu_items

Let’s take a look at wp_get_nav_menu_items code reference. It takes two parameters: $menu – (int|string|WP_Term) (Required) Menu ID, slug, name, or object, $args – (array) (Optional) Arguments to pass to get_posts(). So we can use get_posts args in here… And if we want to get only top-level posts, then post_parent arg comes useful… So something … Read more

HTML Bootstrap navigation menu to WordPress menu using wp_nav_menu

You have to edit the files in: wordpress/wp-content/themes/twentyseventeen/template-parts/navigation/navigation-top.php and then create a custom walker, try to take a look here. Try in this way: <?php /** * Displays top navigation * * @package WordPress * @subpackage Twenty_Seventeen * @since 1.0 * @version 1.2 */ ?> <div class=”container”> <nav class=”navbar navbar-expand-lg navbar-light” id=”mainNav”> <a class=”navbar-brand js-scroll-trigger” … Read more

Using FlexNav with WordPress [closed]

You don’t need a custom walker function. You can alter wp_nav_menu like this: wp_nav_menu( array( ‘theme_location’ => ‘primary’, ‘menu_class’ => ‘flexnav’, //Adding the class for FlexNav ‘items_wrap’ => ‘<ul data-breakpoint=”800″ id=”%1$s” class=”%2$s”>%3$s</ul>’, // Adding data-breakpoint for FlexNav )); and proper script init should be: jQuery(document).ready(function($){ $(“.flexnav”).flexNav({ }); }); Drop menu button somewhere outside navigation: <div … Read more

Add Page ID class to nav menu items

We can add custom nav menu classes through the nav_menu_css_class filter. Example: The following should add the CSS class wpse-object-id-{object_id} to the <li> tags: // Add filter add_filter( ‘nav_menu_css_class’, ‘wpse_menu_item_id_class’, 10, 2 ); // Your navigational menu wp_nav_menu( $args ); // Remove filter remove_filter( ‘nav_menu_css_class’, ‘wpse_menu_item_id_class’, 10, 2 ); where we define the filter callback … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)