Support » Plugin: Page Templater For Elementor » add some php code to an elementor page

  • i wish to add this code to all the elementor pages. if i add it in the header.php it still dosn’t show. can you help please ?

    here is the code:

    <?php if( get_field('hide_popup') ) { ?>
    	<style>
    		div.sticky-popup {display:none!important;}
    	</style>
    <?php } ?>
Viewing 1 replies (of 1 total)
  • Use the following code in your child theme’s functions.php

    <?php 
    function custom_hide_popup {
    	if( get_field('hide_popup') ) { ?>
    		<style>
    			div.sticky-popup {display:none!important;}
    		</style>
    <?php }
    } 
    add_action( 'wp_head', 'custom_hide_popup', 99 );
    • This reply was modified 2 years, 1 month ago by  WPDevHQ.
    • This reply was modified 2 years, 1 month ago by  WPDevHQ.
Viewing 1 replies (of 1 total)
  • The topic ‘add some php code to an elementor page’ is closed to new replies.