Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1214490
    aya.solutions
    Participant

    Hello,

    may you can tell me de difference between the:

      wp-header.php (/wp-content/themes/x/framework/views/your-stack-name)
      header.php (/wp-content/themes/x)
      _header.php (/wp-content/themes/x/framework/views/global)

    After researching it seems there are different option how to add a code in the “header”
    I would like to ad a code from HotJar – I have installed the Child Theme

    additional: where do I exactly paste the code in?

    Best regards

    #1214499
    aya.solutions
    Participant
    This reply has been marked as private.
    #1214826
    Lely
    Moderator

    Hi There,

    First: header.php (/wp-content/themes/x)
    <?php x_get_view( x_get_stack(), 'wp', 'header' ); ?>
    That line of code from that file is calling wp-header.php (wp-header.php (/wp-content/themes/x/framework/views/your-stack-name) from your specific stack. It is made that way for each specific stack designs.

    Next: wp-header.php (/wp-content/themes/x/framework/views/your-stack-name)
    On this file, you can see first this line:
    <?php x_get_view( 'global', '_header' ); ?>
    That line calls for third file :_header.php (/wp-content/themes/x/framework/views/global). This file contains the opening of the HTML structure including the headings and body tag opening. This is in global folder because this is present on all stacks.

    The next content after that line of code are stack specific functionalities.

    Hope this helps.

    #1253605
    aya.solutions
    Participant
    This reply has been marked as private.
    #1253885
    Jade
    Moderator

    Hi there,

    We can add the code through the child theme’s functions.php:

    function my_custom_head_output() {
      ?>
        ...code here for the header...
      <?php
    }
     
    add_action( 'wp_head', 'my_custom_head_output', 99999 );
    
    function my_custom_body_output() {
      ?>
        ...code here after the body tag...
      <?php
    }
     
    add_action( 'x_before_site_begin', 'my_custom_body_output', 99999 );

    Hope this helps.

    #1254481
    aya.solutions
    Participant

    Jop – thank you very much

    By the way: you are all doing a good job – and your support is awesome 🙂

    Best regards

    #1254530
    Thai
    Moderator

    You’re most welcome 🙂

    If you need anything else please let us know.

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