Skip to main content

Hello, I have done a lot of digging in the forums and still haven’t found the answer I am looking for, so I thought I would try here…

 

I want to either embed a Klaviyo form to my website or create an entire landing page with one. Most of instructions I have seen to do involve putting the snippets of code in the footer. However, I use pages without a header or footer (aka my landing page). So is there another way to put in the code snippet that would run on the entire site, even if there is not a header and footer on a specific page.

 

P.S I use Wordpress and Elementor Pro as the page builder. I don’t use WooCommerce because I am a service based business.

Paste this in your functions.php file:

 

/* Describe what the code snippet does so you can remember later on */
add_action('wp_footer', 'your_function_name');
function your_function_name(){
?>

PASTE FOOTER CODE HERE

<?php

};

 

You can change ‘your_function_name’ to anything you want, but do it in both places. (No spaces allowed.)


@DavidSandel I tried this before but it only works for pages with a footer. And some of my pages dont have a header and footer because I use them as a landing page. 


Could you create an “empty” footer in the Elementor Theme Builder to run on every page? Nothing would be displayed on the frontend of the site since it’s empty, but at least you’d have a container to put the code snippet.


@DavidSandel Got it! I was able to insert some custom code into all pages using with Elementor Pro. So the code snippet is somewhere in the head of each page. So it works whether there is a footer or not. You have a great suggestion though too, and would be a nice work around for someone not with Elementor Pro. Thank you!


Reply