- This topic has 18 replies, 2 voices, and was last updated 3 years, 2 months ago by
Fernando.
-
AuthorPosts
-
February 22, 2023 at 12:48 am #2542202
Robert
Hi,
I have a directory on my site using Directories Pro plugin. I also have a regular blog type format.I am trying to have a different header for the directory aspects. I have contacted you previously regarding the menu and will try the conditional menu plugin.
I am having another issue and I am not sure if it is GP or the Directories Pro plugin.
I have managed to enable and exclude the two headers I have for different pages within the elements editor.
I have tried to do the same thing for the custom categories generated by the directory plugin.
In the header element editor it allows me to enable and exclude the two headers as I have done previously with different specific pages but when I check the category page nothing changes.
I have cleared cache etc and even made other changes to other pages to check and they update correctly.
On the actual directory category page (such as https://cryptosavvylife.com/discover-crypto/categories/agtech/ )it shows the elements loaded and they are the ‘old’ original ones. With the original Block Site Header rather than the new Discover Crypto Header.
However, within the element editor, it shows the new header should be enabled and the original excluded.Am I missing something?
(I have screen grabs but am not sure how to share them)Regards,
RobFebruary 22, 2023 at 1:18 am #2542221Fernando Customer Support
Hi Robert,
Can you provide admin login credentials instead so we can take a closer look at your setup?
Please use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information
February 22, 2023 at 1:42 am #2542251Robert
Thanks,
That would be greatly appreciated.February 22, 2023 at 2:04 am #2542270Fernando Customer Support
Can you try removing the Category in the Display Rule location and re-adding it?
February 22, 2023 at 2:06 am #2542274Robert
Hi,
I have tried and tried to do it for other categories that were created with the same results.Will try doing it now (remove AGTECH) and then redo it for the AI category.
Thanks,
February 22, 2023 at 2:10 am #2542281Fernando Customer Support
Alright. Let us know how it goes.
February 22, 2023 at 2:11 am #2542282Robert
Hi,
I have done that for category/ai and have the same thing.Thanks,
February 22, 2023 at 2:17 am #2542286Robert
Within the Directories Pro plugin there is an option to assign your own custom permalink and also to point to a custom page for the location.
I am sure this has something to do with it as the breadcrumbs on the category page seem wrong.I can adjusting some of the settings in Directories Pro unless you have any other suggestions.
Thanks,
RobFebruary 22, 2023 at 2:20 am #2542290Fernando Customer Support
I see. Can you try adding this snippet?:
add_filter( 'generate_block_element_display', function( $display, $element_id ) { if ( 19180 === $element_id && is_category( array('182','180' ) ) ) { $display = false; } return $display; }, 10, 2 );Adding PHP: https://docs.generatepress.com/article/adding-php/#code-snippets
February 22, 2023 at 2:30 am #2542303Robert
Hi,
I loaded the plugin etc and got this error:
Don’t Panic
The code snippet you are trying to save produced a fatal error on line 3:syntax error, unexpected token “;”
The previous version of the snippet is unchanged, and the rest of this site should be functioning normally as before.Please use the back button in your browser to return to the previous page and try to fix the code error. If you prefer, you can close this page and discard the changes you just made. No changes will be made to this site.
February 22, 2023 at 2:38 am #2542314Robert
Hi Fernando,
Im fairly certain its is a directories pro thing.The URL I was expecting ( https://cryptosavvylife.com/directory-research/categories/ai/) says the page cannot be found. The URL it is displaying instead when clicking on some links ( https://cryptosavvylife.com/discover-crypto/categories/ai/) is not what the GP elements editor is finding.
I think I should investigate that before you spend anymore time on it.
I will wait for you to confirm.
Thanks,
RobFebruary 22, 2023 at 2:39 am #2542317Fernando Customer Support
I updated the code I provided above. Can you retry adding it?
February 22, 2023 at 2:41 am #2542319Robert
Sure, but where is the updated code?
February 22, 2023 at 2:43 am #2542321Robert
Sorry realised the above had changed, have run the snippet.
February 22, 2023 at 2:55 am #2542328Fernando Customer Support
Try this one:
add_filter( 'generate_block_element_display', function( $display, $element_id ) { if ( 19180 === $element_id && is_tax( 'category', '180' ) ) { $display = false; } return $display; }, 10, 2 );Replace
categoryin the code if the plugin you are using is using a different taxonomy slug.This code is for
agtechcategory. -
AuthorPosts
- You must be logged in to reply to this topic.