Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1048413
    president75
    Participant

    Hi

    I would like to do this for my site:

    http://www.ninoblasco.com/wordpress-spostare-i-file-javascript-nel-footer-php/

    As I have suggested I use a child theme. How do I change the header.php and footer.php !?

    Thanks

    #1048414
    president75
    Participant
    This reply has been marked as private.
    #1048451
    Christopher
    Moderator

    Hi there,

    Please add this in functions.php file :

    
    //Add code to wp_head
    function custom_code_in_header() { ?>
    
      
        // Add your code below this line
      
    
    <?php }
    
    add_action( 'wp_head', 'custom_code_in_header' );
    
    //Add code to wp_footer
    
    function custom_code_in_footer() { ?>
    
      
        // Add your code below this line
      
    
    <?php }
    
    add_action( 'wp_footer', 'custom_code_in_footer' );

    Hope it helps.

    #1048522
    president75
    Participant

    This code just to do everything described in the article !?

    I would like to understand. How is it that you changed only functions.php instead they modificanoanche header.php and footer.php.

    I want to learn for the next time.

    Thank you

    #1048629
    Nabeel A
    Moderator

    Hi there,

    Let’s look at this code:

    //Add code to wp_head
    function custom_code_in_header() { ?>
    
      
        // Add your code below this line
      
    
    <?php }
    
    add_action( 'wp_head', 'custom_code_in_header' );

    Anything you write under // Add your code below this line this line, will be added in your <head> section of your site. Same is the case with the footer.

    Hope this helps!

    #1048686
    president75
    Participant

    Ok. I get it. But you can tell me the full code to move the script at the bottom of the page. I am not very practical code but I know this helps for the speed of the site.

    Can you help me.

    Thank you

    #1049033
    Rue Nel
    Moderator

    Hello There,

    Thanks for the updates! If you want to easily add things to the header or footer, you can also customize your header.php and footer.php by copying the files from wp-content/themes/x/framework/views/integrity/wp-header.php and wp-content/themes/x/framework/views/integrity/wp-footer.php and place it in your child theme’s folder wp-content/themes/x/framework/views/integrity/. For more details, please review how we recommend making template changes in Customization Best Practices.

    Hope this helps.

  • <script> jQuery(function($){ $("#no-reply-1048413 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>