- This topic has 11 replies, 3 voices, and was last updated 5 years, 3 months ago by Tom.
-
AuthorPosts
-
December 31, 2018 at 10:31 am #770036Kevin
Here is the script:
<script>
if (window.convertflow == undefined) {
var script = document.createElement(‘script’);
script.async = true;
script.src = “https://js.convertflow.co/production/websites/3983.js”;
document.body.appendChild(script);
};
</script>I added the code in elements to GP_Head and told it to show on a specific page (see admin area)
I am trying to get this form to display with a background of #F2F2F2 and have it float centered left/right up/down
December 31, 2018 at 11:35 am #770042LeoStaffCustomer SupportHi there,
Are you sure that code is supposed to go in wp_head?
I’m not seeing a form showing up on the page you linked.
As for changing the background color, I don’t believe CSS will work inside
<script>
tag like that. Have you checked with the code author on how to do that?December 31, 2018 at 5:44 pm #770169KevinOn my other wordpress site (not generatepress) I just this script into a code box and it works perfect.
I have no idea on how to do this on generatepress so I tried following the tutorial on elements but I got nowhere.
How do I inject this code onto a single WordPress page in generatepress
Thanks!
January 1, 2019 at 9:12 am #770497TomLead DeveloperLead DeveloperHow exactly did you add it to your previous theme? Inside the content area? Typically, WordPress doesn’t allow script elements inside the content.
January 1, 2019 at 1:00 pm #770596KevinThey have a “code” box you drop into a section and just dump the script inside.
You can see it in operation Wildernessedge.thedev.ca right at bottom just before the footer.
How do I add this code to generatepress? My goal is transfer my current enfold theme to yours?
January 1, 2019 at 5:30 pm #770678TomLead DeveloperLead DeveloperIf you’re using the new editor in WordPress, you should be able to add a Code block, and put that code into the block.
That should make the form appear wherever you add the code.
January 1, 2019 at 7:02 pm #770701KevinThanks, but I have gutenberg disabled.
What is the next best method?Thanks much,
KevinJanuary 2, 2019 at 9:12 am #771276TomLead DeveloperLead DeveloperYou could create a shortcode with it:
add_shortcode( 'convertflow', function() { ob_start(); ?> Your script here <?php return ob_get_clean(); } );
Then you can add the
[convertflow]
in your content.January 2, 2019 at 10:17 am #771332Kevinok, so I installed the snippet plugin
Put an echo line to make sure it was working on my page, which is does
But still no love in executing this js
add_shortcode( ‘convertflow’, function() {
ob_start();
?>
// Start your PHP belowecho ‘short code example’;
// End your PHP above
<script>
if (window.convertflow == undefined) {
var script = document.createElement(‘script’);
script.async = true;
script.src = “https://js.convertflow.co/production/websites/3983.js”;
document.body.appendChild(script);
};
</script><?php
return ob_get_clean();
} );Thanks for your patience
January 2, 2019 at 5:05 pm #771586TomLead DeveloperLead DeveloperHmm, are there any errors in the console if you right click + inspect?
If the code is being outputted within the HTML, then there isn’t much more the theme itself can do. It’s on the script itself to take over and display what it needs to display.
January 3, 2019 at 8:23 am #772200Kevinok. super strange. If I switch the whole thing over to the Enfold theme it works. Just get this error when working with generatepress theme.
thanks for all your help.
Kevin
January 3, 2019 at 9:36 am #772280TomLead DeveloperLead DeveloperThat is strange. Can you link me to a specific page where it should be showing up inside the content?
-
AuthorPosts
- You must be logged in to reply to this topic.