Web Development & WordPress

Optimize Press SmartTheme Shows something at the bottom of single post and just above footer

So client wanted to show his script ( form optin script) to be showing in single post page at the very bottom and just above the footer in full width …

Optimize Press  SmartTheme Shows something at the bottom of single post and just above footer

Here is the code I have used, use this in function.php or use code snippet plugins.

function insert_ontraport_script_after_post() {
    // Only load this script on single post pages
    if (is_single()) {?>
<style>
	#frm {
    background: url(your image url);
    clear: both;
     
    display: flex;
    justify-content: center;
    
    background-size: cover;
    background-repeat: no-repeat;
		position:relative;
		background-attachment:fixed;
}
div#frm iframe {
    padding-top: 2%;
    padding-bottom: 2%;
    height: 560px !important; 
    width: 70% !important;
}
	div#frm::before {
    content: "";
    position: absolute;
    width: 100%;
    background: rgb(51 48 48 / 40%);
    height: 100%;
}
</style>
<?php
 echo "<div id='frm'> Your Code or script will go here </div>";
    }
}
add_action('op_single_after_post', 'insert_ontraport_script_after_post');

so the output ( based on the script i used for my client) will be looking like this

Leave a comment