Jump to content

Archived

This topic is now archived and is closed to further replies.

dreamsight

stop messing with my code :~}

Recommended Posts

dreamsight

Hi

I have a shortcode in WP that inserts a JavaScript function onto the page (it's a lot of code). as it is being processed by pagelines it is inserting newlines into the javascript code and stopping the JavaScript function itself from working is there any way to wrap the code or stop pagelines processing it so that it does not affect the code and just inserts it on the page "as is"?

 

It works fine on a standard wordpress site but not in any pages dev'd in pagelines.

 

the problem is it seems to insert a newline before <p /> <ul /> + <li data-hash="'+t.a[v].hash+'" /> that the JavaScript is using to display the code correctly I am assuming that pagelines does this in an attempt to tidy the html code on these specific html tags, unfortunately in my case I need to stop this behaviour, is there any way to do this?

 

It is also automatically inserting ® where ( r ) is in the script.

 

This is what it should look like:
http://forum.pagelines.com/pst/rw/113-ut3n2j/

This is what it looks like after pagelines:
http://forum.pagelines.com/pst/p/114-srzwgj/

Thanks, any suggestions welcome

 
 
 
 
 
 
 

Share this post


Link to post
Share on other sites
Danny

HI,

 

I recommend you enqueue the code instead adding it via a shortcode or adding it to a section. Use the WordPress enqueue function instead.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
dreamsight

HI,

 

I recommend you enqueue the code instead adding it via a shortcode or adding it to a section. Use the WordPress enqueue function instead.

 

 

Hi Danny

Thank you for your recommendations do you have any idea why this is happening? Wordpress is fine with it without pagelines.

 

The script is a captcha script and is created and generated dynamically at the time of the request so in actual fact the script does not physically exist until generated at any given point and/or until called from the shortcode.

 

It also has to be located and displayed in the correct position on the form and page of which the normal shortcodes work fine without pagelines installed and/or on a pagelines page so I believe this has nothing to do with wordpress itself.

 

Problem here is I can’t give enqueue a script to load as it only exists as an assembled string in memory at a point when it’s called, I may be able to point to a template but that will exclude it's keys for the capcha itself whitch defeats the object of the exersise I may be able to give it it’s dependencies though? Dunno I haven’t looked down this avenue hard enough yet or used enqueue enough to comment more fully at this point.

 

This way regardless means re-writing parts of the code and scripts to suit pagelines, the script has to be generated dynamically in any case.

 

Is there any other option?

 

Paul

 

 
 
 

Share this post


Link to post
Share on other sites
Danny

Trying wrapping your shortcode with this:

 

[pl_raw]

[your_shortcode]

[/pl_raw]

 

It is actually WordPress adding those p tags and line-breaks, not DMS. If it works in another theme, they're probably not using a WordPress function.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites
dreamsight

Trying wrapping your shortcode with this:

 

[pl_raw]

[your_shortcode]

[/pl_raw]

 

It is actually WordPress adding those p tags and line-breaks, not DMS. If it works in another theme, they're probably not using a WordPress function.

 

Hi Danny
                I am pretty sure we tried [pl_raw] will need to ask my colleague, I will put their site on my test server and narrow down that side of things, it may be theme and wordpress related but there’s only one real way to find out, will get back to you with the results.

 

Does DM use any filtering mechanisms in this area? And/or double process the code through wordpress? By this I mean after wordpress has compiled the page and put everything in place does DM re-process it again?

 

Regards

Paul

 

Share this post


Link to post
Share on other sites
dreamsight

Tried [pl_raw][GBLCAPTCHA][/pl_raw] and it disappears completely

Share this post


Link to post
Share on other sites
Danny

OK, then there is something in that script that is causing a conflict with the DMS editor scripts. I recommend you use the correct method as by the WordPress guidelines and use the enqueue function in a child theme.


Please search our forums, before posting!

Share this post


Link to post
Share on other sites

  • Similar Content

    • Lisa Haran
      By Lisa Haran+
      Hi 
      I have a map here http://www.iloveoffset.com/maps/
      I want to add several pointer locations to the map, but when I do they do not appear.
      On this map there are 2 pointer locations and as you can there is only one visible.
      Earlier today I added 7 and could only see 4 so there is something odd going on.
      My theme is up to date
    • clj182
      By clj182+
      Hello,
      I've been having trouble unlocking the template section for past couple of weeks. When I try clicking nothing happens. 
      I've deleted my custom css and removed plugins. Im down to having only the following plugins:
      Akismet
      Contact Form 7
      DMS Professional Tools
      Pagelines Updater
      WooCommerce
      It was working fine before i have no idea what's going on with it.
    • flourishdesignstudio
      By flourishdesignstudio+
      My DMS 2 site http://www.heart-stone.com/ will not save any new custom css... I can still edit templates and publish those but any custom css that I enter never saves.
      All WP files, themes, and plugins are up to date. 
      Any thought about what might be causing this?
    • flourishdesignstudio
      By flourishdesignstudio+
      Is there a way to edit the custom CSS via FTP? I know I can edit the custom code in the Chrome editor but is there a file path I can use to find and edit the CSS directly from our FTP?
      Thanks in advance for the help!
    • nizami
      By nizami+
      Using navbar section with correctly configured WP menu to display main navigation at https://elenaangel.com. 
      All fine in desktop viewport. Menu displays twice in hamburger mode. How to fix this please? 

×