bauwb
Forum Replies Created
-
A friend of mine helped me out. This is how I fixed it:
add_filter('wp_get_nav_menu_items', 'my_theme_nestjes_menu_filter', 10, 3); function my_theme_nestjes_menu_filter($items, $menu, $args) { $menu_order = count($items); $mapping = [ // class => post_type 'nestjes-parent-item' => 'nestjes-post-type', 'katers-parent-item' => 'katers-post-type', 'poezen-parent-item' => 'poezen-post-type', ]; foreach ($mapping as $class => $post_type) { // Find menu items with class. $items_with_class = array_filter($items, function($item) use ($class) { return is_array($item->classes) ? in_array($class, $item->classes) : FALSE; }); // We found items. if (!empty($items_with_class)) { // Use first menu item. $first_item_with_class = reset($items_with_class); // Load all posts within the post_type. foreach (get_posts('post_type=' . $post_type . '&numberposts=-1') as $post) { // Build new menu items. $post->menu_item_parent = $first_item_with_class->ID; $post->post_type = 'nav_menu_item'; $post->object = 'custom'; $post->type = 'custom'; $post->menu_order = ++$menu_order; $post->title = $post->post_title; $post->url = get_permalink($post->ID); // Add item to menu. array_push($items, $post); } } } return $items; }
- This reply was modified 3 years, 10 months ago by bauwb.
I appreciate your reply very much but unfortunately I have to admit I’m still a newbie in code. I’ve tried a lot of stuff already but everything I tried gave me errors.
How would the correct code look like? Could you help me with that? Highly appreciated!
Forum: Plugins
In reply to: [Complianz - GDPR/CCPA Cookie Consent] Cookie banner won’t disappearHello,
I tried to implement this code into my functions.php file but it didn’t work. I think I will leave it like it is. Will the plugin work either way or is it broken because of this error message?
Forum: Plugins
In reply to: [Complianz - GDPR/CCPA Cookie Consent] Cookie banner won’t disappearDear Aert
On the front-end everything is working correctly now. (I think at least?) In the back end though I am experiencing some problems. I can’t enable the plugin ‘CF7’ anymore in the Complianz settings. If I enable it and click save, it automatically disables.
Also, after updating Complianz today I am receiving this error message in the back end saying: “jQuery was not detected on the front-end of your site. Complianz requires jQuery. For more information on this subject, please read this article”
But again, on the front end everything is working fine. So I’m not sure if I actually need to do something to fix this error?
Thank you for all the help. Highly appreciated!
Forum: Plugins
In reply to: [Complianz - GDPR/CCPA Cookie Consent] Cookie banner won’t disappearI have disabled the integration of CF7 within Complianz and now my initial problem has been solved! The banner disappears when I click accept.
Now I’m not sure anymore if Complianz is actually blocking anything (which should be blocked)?
Forum: Plugins
In reply to: [Complianz - GDPR/CCPA Cookie Consent] Cookie banner won’t disappearDear Aert
Contact Form 7 plugin > settings > Integration > (reCAPTCHA V3) Setup Integration > entered site key + secret key
This gives me a check mark and “reCAPTCHA is active on the site”.
I am using this custom CSS though to hide the recaptcha badge:
.grecaptcha-badge{
visibility: collapse !important;
}Do I have to delete the integration inside of CF7 or disable the plugin inside of Complianz? Because I would still like to use the recaptcha functionality.
Forum: Plugins
In reply to: [Complianz - GDPR/CCPA Cookie Consent] Cookie banner won’t disappearDear Aert
Oh, I remember that I have added the google site verification in there exactly, but I have already removed it. My script center is empty, top to bottom. Do I have to look somewhere else to delete it?
I now also published my GTM container.
Forum: Plugins
In reply to: [Complianz - GDPR/CCPA Cookie Consent] Cookie banner won’t disappearNow I have disabled ‘Aggregate JS-files’ in Autoptimize and now I get this error:
Uncaught SyntaxError: expected expression, got ‘<‘
jQuery 5
cmplzRunInlineScript https://orthosystems.be/wp-content/plugins/complianz-gdpr/assets/js/complianz.min.js?ver=4.7.2:1
cmplzEnableMarketing https://orthosystems.be/wp-content/plugins/complianz-gdpr/assets/js/complianz.min.js?ver=4.7.2:1
jQuery 2
cmplzEnableMarketing https://orthosystems.be/wp-content/plugins/complianz-gdpr/assets/js/complianz.min.js?ver=4.7.2:1
cmplzFireCategories https://orthosystems.be/wp-content/plugins/complianz-gdpr/assets/js/complianz.min.js?ver=4.7.2:1
cmplzAcceptAllCookies https://orthosystems.be/wp-content/plugins/complianz-gdpr/assets/js/complianz.min.js?ver=4.7.2:1
<anonymous> https://orthosystems.be/wp-content/plugins/complianz-gdpr/assets/js/complianz.min.js?ver=4.7.2:1
jQuery 9
<anonymous> https://orthosystems.be/wp-content/cache/autoptimize/js/autoptimize_single_a9a5b111b7cfe863feae12f6340d58e3.js?ver=6.493:14
<anonymous> https://orthosystems.be/wp-content/cache/autoptimize/js/autoptimize_single_a9a5b111b7cfe863feae12f6340d58e3.js?ver=6.493:16Forum: Plugins
In reply to: [Complianz - GDPR/CCPA Cookie Consent] Cookie banner won’t disappearDear Aert
I have Complianz enabled right now.
This is the error I got:
Uncaught SyntaxError: expected expression, got ‘<‘
jQuery 5
cmplzRunInlineScript https://orthosystems.be/wp-content/cache/autoptimize/js/autoptimize_be086efb1a101864792f8c4b62039639.js:208
cmplzEnableMarketing https://orthosystems.be/wp-content/cache/autoptimize/js/autoptimize_be086efb1a101864792f8c4b62039639.js:208
jQuery 2
cmplzEnableMarketing https://orthosystems.be/wp-content/cache/autoptimize/js/autoptimize_be086efb1a101864792f8c4b62039639.js:208
cmplzFireCategories https://orthosystems.be/wp-content/cache/autoptimize/js/autoptimize_be086efb1a101864792f8c4b62039639.js:208
cmplzAcceptAllCookies https://orthosystems.be/wp-content/cache/autoptimize/js/autoptimize_be086efb1a101864792f8c4b62039639.js:208
<anonymous> https://orthosystems.be/wp-content/cache/autoptimize/js/autoptimize_be086efb1a101864792f8c4b62039639.js:208
jQuery 2It looks like it has something to do with Autoptimize?
I haven’t used the script center btw.Thank you for your help!
Forum: Fixing WordPress
In reply to: Pages wider than viewportHey Luka, it works. Problem solved. Thank you lots!!!