Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #606607

    I want to add some code to my page but not have it be inside a codeblock, any way to do this?
    Specifically I want to add it as a direct child of the “<body>” tag and preferably right at the end before the closing “</body>”

    #606613

    Hi morecolor!

    Please edit the themes\enfold\footer.php file and add your code before </body>
    We recommend using a child theme to do any custom modifications

    Regards,
    Vinay

    #606618

    Hi Vinnie thanks for the quick reply,
    I forgot to specify that I just want to have the code on 1 page and not all pages.

    #606645

    Hey!

    Please add following code to Functions.php file in Appearance > Editor

    
    function my_custom_target(){
    if(is_page(21)){
    ?>
    // YOUR CODE GOES HERE
    <?php
    }
    }
    add_action('wp_footer', 'my_custom_target');

    21 here is the page ID. Please change it to match your page’s ID

    Best regards,
    Yigit

    #606901

    Excellent thanks for this, very useful.
    Any easy way to make this code only show on desktop and not mobile?

    #607163

    Hi,

    Add a class or ID to whatever code you are using, then you can use the following CSS:

    @media only screen and (max-width: 767px) {
    .your-class {
    display:none;
    }
    }

    Regards,
    Rikard

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.