Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #335414

    Hello, I’m creating a Facebook Tab which will show one of my page.
    I should insert in the body of the page some <script> ..>/script> code, just after the >body> tag, and only in the page called by Facebook.
    Can I ask your kind help in directing me in the right direction ? I can I accomplish the task ?
    Thanks a lot
    Kind regards
    Antonio

    #335926

    Hey lombrano!

    Thank you for using Enfold.

    Please use this on functions.php:

    function add_body_script(){
    ?>
    <script>
    
    </script>
    <?php
    }
    add_action('ava_after_main_container', 'add_body_script', 10);

    Use wordpress conditional if you want to show it on a specific page. http://codex.wordpress.org/Function_Reference/is_page

    Cheers!
    Ismael

    #341163

    Hello Ismael,

    sorry for my late answer.
    The code works perfectly, thank you !
    But … how can I use the is page( ) to put the script only on one specific page ? Where do I put the is page code ? Can you please help me modifying the code you suggested ?

    Thanks a lot for your help

    Antonio

    #341349

    Hi!

    Something like this:

    function add_body_script(){  if(is_page('PAGE ID/NAME HERE')) {
    ?>
    <script>
    
    </script>
    <?php
    }
    }
    add_action('ava_after_main_container', 'add_body_script', 10);

    Best regards,
    Ismael

    #341476

    Thanks a lot again !

    Antonio

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Facebook Code in Page Body’ is closed to new replies.