Hi I have sidebar pages widget working for all custom posts types on my site perfectly fine.
One post type will not show the sidebar for existing pages but it will show it for new posts that I add.
Is there a particular config or setting the post must have to show up? The post type is set as “Heirchachil” and the posts have all been mapped with Parent / Relationships. I have checked everything in the database against the new posts that show up and the old posts that do not show up.
Is there a parent particular field/item your module looks for in the database I could check to see if there is something wrong with these posts?
OnPoint Plugins
Hi Dion,
The only thing that is checked in the database when determining if the widget should display is for child pages. If the widget does not have “Display highest level parent page”, checked and you are viewing a page which has no parents or children, the widget will not show up. Otherwise, the widget functions the same for every post of the same type.
One thing to check would be the a page cache as it sounds like the issue only affects previously existing pages.
If you can send me the following, I can take a look:
Dion Bairle
Thanks our site is in staging and behind a fireall so can not give access.
Just an update on this, I have since found going into a post, unpublishing it, and then republishing it makes the posts appear in the sidebar menu.
I have tried to do this in bulk via quick edit but it does not work, you have to open a post and physically unpublish it and republish it.
Would you know what would cause this and if there is a way to automate this fix rather than having to unpublish and republish each post as I have about 1500+ posts.
I am not running any caching software plugins.
Dion Bairle
Also just wanted to add, we are also using “Uber mega menu” and JetEngine and both of these plugins they are both able to query the hierarchy and display the hierarchy mapping of posts perfectly fine.
It’s only this plugin that is having issues.
Any ideas are greatly appreciated.
OnPoint Plugins
Hi Dion,
Without seeing the page(s) we don’t have much to go on. Here are a few things to try:
Page builder plugins:
If you are using a page builder plugin such as Elementor, Beaver Builder, or Motopress, it’s possible the widget content is not stored correctly in the template caches and is refreshed when a page is opened and saved. Clearing the template cache for your page builder plugin is a good place to start.
Excluded pages:
This plugin supports excluding pages use a post meta key called ‘advanced-sidebar-menu-pro/exclude-this-page’. If somehow this meta key ended up in the database it could explain what is going on. You may delete this key from the database using the following query. You will have to change the “wp_postmeta” to match your table if you are not using the default
wp
table prefix.DELETE from wp_postmeta WHERE meta_key = 'advanced-sidebar-menu-pro/exclude-this-page';
Other plugins
Because the post editor must load for saving to fix this issue, it’s possible another plugin is filtering the queries on the site and saves data on the post edit screen. You can rule this out by deactivating other plugins one at a time to see if having one deactivated resolves the issue. If this is the case, it’ll likely be a plugin which has a meta box or fields of some kind on the post edit screen.
If a plugin is tapping into query filters and not doing a
is_main_query()
check, it will affect the queries used to render the menus. Some of the common filters are:pre_get_posts
parse_query
posts_results
posts_request
A quick way to rule out query filters is to add the following filter to disable all query filters. Note, this may affect which items are included in the menus and should be used for debugging purposes only.
Dion Bairle
Thanks for the detailed information.
Ended up updating all the posts and they are back now if it continues we will dig deeper based on your suggestion.