When reading a post, menu does not light up

Hi there,

My website has 5 menu-items (domain.nl/topic-1/ etc.). 4 of them are ‘filled’ with several pages about that topic (domain.nl/topic-1/page-name/) and 1 of them is filled with posts. To make the url-structures look all the same, I made sure the permalink of all posts is: domain.nl/topic-5/post-name/ (using Wordpress’ settings).

That causes two errors that hopefully can be fixed somehow:

  1. When people are reading a post, the menu item at the top of the page does not show a little blue line, indicating that they are in that specific section of the website. (That only happens when they read a page.)
  2. When using custom sidebars, a post-sidebar that I created does not show up when I select the ‘parent-page’ of my posts. Nor does it appear when I select tags that correspondent with the posts.

To be more specific:

Hopefully you understand what I mean. I tried my best, but it’s pretty complicated, so please let me know if you have further questions.

Thanks a lot in advance,
Sjors

Hello Sjors,

Thanks for writing in! I can see the issue here. To resolve this one, please add the following CSS code in the X > Launch > Theme Options > Global CSS (http://prntscr.com/evui3r)

.x-navbar .desktop .x-nav>.current_page_parent>a {
    box-shadow: inset 0 4px 0 0 #47a0d9;
    color: #b7b7b7;
}

We would loved to know if this has work for you. Thank you.

Hi @RueNel,

Thanks for your reply! It does fix the first problem (menu). However, the custom sidebar I created for the parent, does not show up on child-posts.

Best,
Sjors

Hello There,

For your sidebar, did you enable the Child page display option?

Would you mind providing us some access to your site so that we can take a closer look?

Thanks.

Yes, I did enable the Child Page Display option.

I have set up an account for you to take a closer look. Please see the credentials in the Secure Note, attached to this message. Thanks in advance!

Hi Sjors,

Can you try clearing browser cache and then check again?
Custom sidebar is showing when on child page when I checked: https://screencast-o-matic.com/watch/cb6Zn3IPj9
Did I miss anything here? Please clarify.

Hi Lely,

You were watching a (child-)page and the error occurs on posts. Here you can see (https://prnt.sc/h1qahx) I selected the parent ‘Interieur’ and enabled the Child Page Display option. Now this post - which parent page is ‘Interieur’ - does not show a sidebar: https://huisa.nl/interieur/inspirerende-badkamer-om-weg-dromen/

One other issue: since your last reply, the plugin Cornerstone is suddenly de-activated. When I try to activate it again, I get this fatal error:

(deleted)

Thanks again,
Sjors

Hi there,

You have two cornerstone, the other one is named to cornerstonecornerstone and you’re activating cornerstone. Please deactivate that first one first.

This one https://huisa.nl/interieur/inspirerende-badkamer-om-weg-dromen/ isn’t a page, but a post. That child option is when you assign a sidebar to a page and it has a child page, it then it will inherit the assigned sidebar. Posts don’t have parent-child feature compared to pages. Unless you registered your post type while inheriting page type features.

If you just wish to assign a specific sidebar to all posts regardless of parent, then add this to your child theme’s functions.php

add_filter( 'ups_sidebar', 'ups_display_sidebar_custom' , 99 );

function ups_display_sidebar_custom ($sidebar) {

if ( is_singular('post') ) return 'ups-sidebar-my-sidebar';
return $sidebar;

}

Then simply assign your widgets to your My Sidebar.

Thanks.

1 Like

Hi @Rad,

Thanks for your help. Your advise helped, this is exactly what I need! :smiley:

One last question (forgive me): is there a css-trick to make the right item ‘active’ in the sidebar? For example, if you visit https://huisa.nl/interieur/5x-inspirerende-keukens-kitchen-rules/ that article does not appear to be opened based on the menu on the right side.

To clear things up: https://prnt.sc/h2nlfd

Thanks again and keep up the good work!
Sjors

Hey Sjors,

Thanks for updating in! For your last question, regretfully this cannot be done because the WP Recent Post widget doesn’t have any class that indicates the current page item. This can only be done with custom development by re structuring the WP Recent Post widget. Please be aware that custom development is way beyond the scope of our support. As such, you will need to investigate this particular issue on your own or seek help from a developer should you not feel comfortable making these changes yourself.

Thank you for your understanding.

That makes sense. No problem, thanks again for your help!

Glad we could help.

Cheers!