Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #669761

    helloeng
    Participant

    hi. yes I understand. I found this possible solution. This is a post from a user on the Ultimate Social Media Plugin support forum:

    ———————–
    hii guys i put this code in header.php here like that and then i didnt get any error message.i dont know but i think maybe it is fixed that way

    * Displays all of the <head> section and everything up till <div id=”main-wrapper” <?php wp_head(); ?> >
    ———————-

    Do you think putting this code in the X header.php might solve this problem? I don’t want to put it in unless X support can tell me that this is ACTUAL CODE and that it will not have a negative effect on X theme itself. If it is proper code, where do you suggest I include it in the X header.php?

    here is the link to the support thread:
    https://wordpress.org/support/topic/how-to-correct-theme-headerphp-file?replies=20

    #669808

    Zeshan
    Member

    Hi Helloeng,

    Thanks for updating the thread! As mentioned in our last response, this issue is related with a third party plugin or its compatibility. Regretfully, we cannot provide support for third party plugins or scripts as our support policy in the sidebar states due to the fact that there is simply no way to account for all of the potential variables at play when using another developerโ€™s plugin or script. Because of this, any questions you have regarding setup, integration, or troubleshooting any piece of functionality that is not native to X will need to be directed to the original developer.

    In the meantime, if you want to put <?php wp_head(); ?> in the header.php file, copy the file wp-content/themes/x/framework/views/global/_header.php in your child theme’s folder /framework/views/global/, open the copied file in a text editor and cut (copy and remove) following code:

    <!DOCTYPE html>
    <!--[if IE 9]><html class="no-js ie9" <?php language_attributes(); ?>><![endif]-->
    <!--[if gt IE 9]><!--><html class="no-js" <?php language_attributes(); ?>><!--<![endif]-->
    
    <head>
      <?php wp_head(); ?>
    </head>
    

    Then copy the file wp-content/themes/x/header.php in your child theme’s root folder, open it in a text editor and add the copied code just above the following line:

    <?php x_get_view( x_get_stack(), 'wp', 'header' ); ?>
    

    Thank you for your understanding. Take care!

    #670021

    helloeng
    Participant

    I’m a little bit confused.

    1. I copied the _header.php file from wp-content/themes/x/framework/views/global/_header.php to wp-content/themes/x-child/framework/views/global/_header.php

    2. I opened the /_header.php in my text editor and cut out the following lines
    <!DOCTYPE html>
    <!–[if IE 9]><html class=”no-js ie9″ <?php language_attributes(); ?>><![endif]–>
    <!–[if gt IE 9]><!–><html class=”no-js” <?php language_attributes(); ?>><!–<![endif]–>

    <head>
    <?php wp_head(); ?>
    </head>

    3. Here’s where I get confused. wp-content/themes/header.php does not exist in my installation (see screenshot)

    So, I don’t know what do with your instructions

    “Then copy the file wp-content/themes/header.php in your child themeโ€™s root folder, open it in a text editor and add the copied code just above the following line:
    <?php x_get_view( x_get_stack(), ‘wp’, ‘header’ ); ?>”

    4. So, wp-content/themes/header.php does not exist in my installation, so I cannot copy it to x-child root folder

    5. Therefore I cannot insert
    <!DOCTYPE html>
    <!–[if IE 9]><html class=”no-js ie9″ <?php language_attributes(); ?>><![endif]–>
    <!–[if gt IE 9]><!–><html class=”no-js” <?php language_attributes(); ?>><!–<![endif]–>

    <head>
    <?php wp_head(); ?>
    </head>

    6. which also means I don’t know where to find this code: <?php x_get_view( x_get_stack(), ‘wp’, ‘header’ ); ?>

    I’d appreciate some more directions as to where to find wp-content/themes/header.php and <?php x_get_view( x_get_stack(), ‘wp’, ‘header’ ); ?>

    Thanks

    #670022

    helloeng
    Participant

    here’s the screenshot of wp-content/themes

    #670073

    Zeshan
    Member

    Hi there,

    Sorry for the confusion, the header.php file is located in the root folder of parent X theme. So the location is wp-content/themes/x/header.php instead of the one given above (I’ve also updated my last response).

    Thank you!

    #670093

    helloeng
    Participant

    see the next message.

    #670100

    helloeng
    Participant

    sorry, correction.

    Ok, so I copy the new file header.php to wp-content/themes/x-child/header.php

    header.php will contain this code:

    <?php

    // =============================================================================
    // HEADER.PHP
    // —————————————————————————–
    // The site header. Variable output across different stacks.
    //
    // Content is output based on which Stack has been selected in the Customizer.
    // To view and/or edit the markup of your Stack’s index, first go to “views”
    // inside the “framework” subdirectory. Once inside, find your Stack’s folder
    // and look for a file called “wp-header.php,” where you’ll be able to find the
    // appropriate output.
    // =============================================================================

    ?>
    <!DOCTYPE html>
    <!–[if IE 9]><html class=”no-js ie9″ <?php language_attributes(); ?>><![endif]–>
    <!–[if gt IE 9]><!–><html class=”no-js” <?php language_attributes(); ?>><!–<![endif]–>

    <head>
    <?php wp_head(); ?>
    </head>
    <?php x_get_view( x_get_stack(), ‘wp’, ‘header’ ); ?>

    Correct?

    #670204

    Zeshan
    Member

    Hi there,

    Yes, that code looks alright to me. However, I cannot guarantee if it will resolve the issue you’re facing with 3rd party plugin. This change will only add wp_head() function to the main header.php instead of the sub directory _header.php file.

    Thank you!

    #670249

    helloeng
    Participant

    Hi. Thanks for your help. Unfortunately it didn’t seem to have worked. The plugin still works and I can use X and cornerstone just fine, so hopefully this error is just a glitch without any negative effect.

    I’ll keep an eye on it.

    Thanks for your patience ๐Ÿ˜‰

    #670383

    Zeshan
    Member

    You’re most welcome! ๐Ÿ™‚

    #671244

    helloeng
    Participant

    Update

    Adding the extra header.php file to wp-content/themes/x-child had the effect that my site did not load at all. Just a white page. So I removed it again, and now everything works as before.

    #671284

    Paul R
    Moderator

    Hi,

    White page usually means there is a syntax error in your code.

    Please make sure you are using correct quotes.

    
    <?php
    
    // =============================================================================
    // HEADER.PHP
    // -----------------------------------------------------------------------------
    // The site header. Variable output across different stacks.
    //
    // Content is output based on which Stack has been selected in the Customizer.
    // To view and/or edit the markup of your Stack's index, first go to "views"
    // inside the "framework" subdirectory. Once inside, find your Stack's folder
    // and look for a file called "wp-header.php," where you'll be able to find the
    // appropriate output.
    // =============================================================================
    
    ?>
    <!DOCTYPE html>
    <!โ€“[if IE 9]><html class="no-js ie9" <?php language_attributes(); ?>><![endif]โ€“>
    <!โ€“[if gt IE 9]><!โ€“><html class="no-js" <?php language_attributes(); ?>><!โ€“<![endif]โ€“>
    
    <head>
    <?php wp_head(); ?>
    </head>
    <?php x_get_view( x_get_stack(), 'wp', 'header' ); ?>
    

    As this issue relates to a third party plugin further customizations from here is outside the scope of support we can offer. If you need more in depth changes, you may wish to consult with the original developer. X is quite extensible with child themes, so there are plenty of possibilities.

    Thank you for understanding.

    #671337

    helloeng
    Participant

    Got it. Thanks for trying to help ๐Ÿ™‚

    #671435

    Zeshan
    Member

    You’re welcome! ๐Ÿ™‚