Re: Two questions

#11
Thanks for detailed info.
I appreciate your patience and time.

I discussed the following request with Mad_Dog.
Portfolio is a page, that you added using a link to the menu. All items included to the page are posts.
They are not related to the menu, that's why the menu item doesn't highlighted when you are on the portfolio posts.
There is no solution, because Pages and Posts are different post types. Unfortunately, we can do nothing because of tech limits.
Jane Clarks

GT3themes Support Team
Discover the Power of GT3themes Products

Re: Two questions

#12
Here is the code to add in your function.php that will work. Please integrate this to your next update.

Code: Select all

 add_action('nav_menu_css_class', 'add_current_nav_class', 10, 2 );
function add_current_nav_class($classes, $item) {
// Getting the current post details
global $post;
// Getting the post type of the current post
$current_post_type = get_post_type_object(get_post_type($post->ID));
$current_post_type_slug = $current_post_type->rewrite['slug'];
// Getting the URL of the menu item
$menu_slug = strtolower(trim($item->url));
// If the menu item URL contains the current post types slug add the current-menu-item class
if (strpos($menu_slug,$current_post_type_slug) !== false) {
$classes[] = 'current-menu-item';
}
// Return the corrected set of classes to be added to the menu item
return $classes;
}



Nothing is impossible!
Regards

Re: Two questions

#16
The thing is that menu higlighted only if you are on the indicated page, the post is absolutely another one.
Menu diesn't higlight whole section, only selected page
Jane Clarks

GT3themes Support Team
Discover the Power of GT3themes Products
Locked

Return to “Fit+ Multipurpose Sports WordPress Theme”

Who is online

Users browsing this forum: No registered users and 1 guest