-
AuthorPosts
-
November 18, 2015 at 4:46 am #669761
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=20November 18, 2015 at 5:28 am #669808Hi 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!
November 18, 2015 at 8:35 am #670021I’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
November 18, 2015 at 8:36 am #670022here’s the screenshot of wp-content/themes
November 18, 2015 at 9:20 am #670073Hi 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!
November 18, 2015 at 9:39 am #670093see the next message.
November 18, 2015 at 9:44 am #670100sorry, 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?
November 18, 2015 at 10:35 am #670204Hi 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!
November 18, 2015 at 11:19 am #670249Hi. 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 ๐
November 18, 2015 at 12:43 pm #670383You’re most welcome! ๐
November 19, 2015 at 4:41 am #671244Update
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.
November 19, 2015 at 5:28 am #671284Hi,
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.
November 19, 2015 at 6:10 am #671337Got it. Thanks for trying to help ๐
November 19, 2015 at 8:25 am #671435You’re welcome! ๐
-
AuthorPosts