Forum Replies Created
-
Author
-
mudandroutesParticipant
Thank you very much Radu!
Works perfectly!
Can you please confirm if this will appear in a future update or do i need to keep these now updated files in the child theme?mudandroutesParticipanthi @radu – i think you’re looking at a diffrent website to mine -i think i sorta hijacked this thread half way through, sorry!
One of the sites – which is easiest for me to disable plugins on as the traffic isn’t important at the moment is this site:I have a plugin in place that limits the rendering of some of the maps (the OS Openspace plugin) as we quickly reach the daily limit with the free API – so you cannot see the maps without loggin in.
For the site above with the issue – screnshot 53
and when i disable OS Openspace plugin then see screnshot 54 – everything now works…Hopefully that makes sense? I’ve re-enabled the plugin on the link provided above so you should see the error in console.
I’ll enable WP_Debug if needed.
Thanks
Attachments:
You must be logged in to view attached files.mudandroutesParticipantHi @radu – thanks for that.
The issue is still there – and i think the code in my functions.php isn’t causing the problems. It’s definitely an issue between the theme and the following plugin – https://wordpress.org/plugins/os-openspace-maps/
I thought it was the code above causing the issue – but even with the code commented out and the proper plugin shortcode used then i’m still getting the error.
mudandroutesParticipantThough just to add – the plugin works when i’m running under 2015 theme and the error is gone…
mudandroutesParticipantThanks for your help @radu – I’ve tried a few more things and it seems that it’s definitely an issue with the plugin rather than the code I’m using in functions.php. I tried it with the regular Kleo theme instead of the child theme as i have a couple of customised widget areas – but still getting the issue.
I’ll play with a few more settings, but i don’t think they’ll make any difference – so i’m going to ask the plugin developer to take a look as i’m getting the same error when all my custom code is commented out.
mudandroutesParticipantThanks for looking into this @radu – the code now looks like this:
COPY CODE// turn any link to a gpx file to a shortcode function osmap_gpx_link_filter( $content ) { $content = preg_replace( '/\\<a href="(.*?\\.gpx).*?a\\>/','[toolset_access role="Guest"][su_note note_color="#f7332a"]<a href="/wp-login.php">Log in</a> or <a href="https://www.mudandroutes.com/register-with-mud-and-routes/">register</a> to see the Ordnance Survey map[/su_note][/toolset_access][toolset_access role="Guest" operator="deny"][osmap gpx="$1"][/toolset_access]', $content ); return $content; } function sqr_late_trigger_rand89() { add_filter( 'the_content', 'osmap_gpx_link_filter' ); add_shortcode( 'map', 'osmap_generator' ); } //add_action('after_setup_theme','sqr_late_trigger_rand89'); //add_action('wp_loaded','sqr_late_trigger_rand89'); add_action('init','sqr_late_trigger_rand89');
Which is hopefully correct (someone else actually did the code – i added the extra shortcodes – i’m able to modify and add snippets but that’s about the limit of my PHP).
Unfortunately, this still brings the same error. I tried each add_action in turn uncommented, cleared the site cache completely and opened a few posts to see if this solved it.
mudandroutesParticipantHi @radu – I’m getting a slightly different issue – it’s a different file that’s causing the issue – see the screen grab.
Indeed – it is an issue in my child theme – and unfortunately it’s from one of the most essential pieces of code from functions.php for my entire site! Specifically we have a preg_replace that’s causing the problem.
COPY CODE// turn any link to a gpx file to a shortcode function osmap_gpx_link_filter( $content ) { $content = preg_replace( '/\<a href="(.*?\.gpx).*?a\>/','[toolset_access role="Guest"][su_note note_color="#f7332a"]<a href="/wp-login.php">Log in</a> or <a href="https://www.mudandroutes.com/register-with-mud-and-routes/">register</a> to see the Ordnance Survey map[/su_note][/toolset_access][toolset_access role="Guest" operator="deny"][osmap gpx="$1"][/toolset_access]', $content ); return $content; } add_filter( 'the_content', 'osmap_gpx_link_filter' ); add_shortcode( 'map', 'osmap_generator' );
This turns any link to a file ending in .gpx into a specific shortcode – not sure why this is misbehaving with the theme all of a sudden. If i comment this out, then everything works – except that this then breaks a load of my posts as this is what converts the gpx files over into a map for our readers. It’s a workaround in order to support legacy posts where different shortcodes were used to embed the files, with the direct link style the one that works best as it’s easiest.
Any idea why the above is causing a problem?
The remainder of my functions.php has only adsense code, a couple of custom widgets andAlso – happy to open a new thread on this if needed as I realise I’ve jumped into this thread with my issue !
Attachments:
You must be logged in to view attached files.mudandroutesParticipantSaw something on Stack Overflow but no idea from the console error in which file the error is occurring? I’d have a tinker around in there if needed, but I don’t even know which file to start with! Hopefully there’s an easy fix (there was an update in the theme today, but still the same for me).
mudandroutesParticipantThis sounds like the same issue i’m experiencing It’s only just appeared, i can’t assign it to any update but I’m getting this error – only when logged in:
Uncaught Error: Syntax error, unrecognized expression: .kleo-main-header .nav > li a[href=#OpenLayers.Map_10_OpenLayers_ViewPort]
The final section of the error after href= is the only thing different, and my guess is that this is the same issue.
I’m getting this on all my sites of sites that are running the same plugins.
Happy to open a new ticket if needed.
The site is – https://www.mudandroutes.com/routes/walk-from-lamlash-to-brodick/– which is one of the pages that has a “Location Map” that’s not appearing due to this error.. If I log out, then the error disappears and everything works fine.
-
AuthorPosts