Misc. code above the header

Hi Team,

I have been using X theme on my website - www.creativeamit.com for past few years with no problems. From past few days my seo on google dropped. I don’t know the reason. But then I thought to restore a previous version from a backup I had. I restored it successfully. I updated everything but I am getting a misc. code which appears above the menu. I don’t know how its appearing on front end. I have attached a screenshot. Can you please help me rectify that.

Regards,
Amit

Below is the code -

?php // ============================================================================= // VIEWS/GLOBAL/_BRAND.PHP // ----------------------------------------------------------------------------- // Outputs the brand. // ============================================================================= $site_name = get_bloginfo( ‘name’ ); $site_description = get_bloginfo( ‘description’ ); $logo = x_make_protocol_relative( x_get_option( ‘x_logo’ ) ); $site_logo = ‘’ . $site_description . ‘’; ?>

Hello Amit,

Thanks for writing in!

The code is coming from the _brand.php file. Did you added this in your child theme? The correct contents of this file should be:

<?php

// =============================================================================
// VIEWS/GLOBAL/_BRAND.PHP
// -----------------------------------------------------------------------------
// Outputs the brand.
// =============================================================================

$option_logo_text = x_get_option( 'x_logo_text' );
$option_logo_src  = x_get_option( 'x_logo' );
$logo_text        = ( empty( $option_logo_text ) ) ? get_bloginfo( 'name' ) : $option_logo_text;

if ( empty( $option_logo_src ) ) {
  $logo_output = $logo_text;
} else {
  $logo_src    = x_make_protocol_relative( $option_logo_src );
  $logo_output = '<img src="' . $logo_src . '" alt="' . $logo_text . '">';
}

if ( x_get_option( 'x_logo_visually_hidden_h1' ) ) {
  echo '<h1 class="visually-hidden">' . $logo_text . '</h1>';
}

?>

<a href="<?php echo home_url( '/' ); ?>" class="<?php x_brand_class(); ?>">
  <?php echo $logo_output; ?>
</a>

You can find this in your child theme if you may have added and modified this file located in this path: wp-content/themes/x-child/framework/views/global/.

Hope this helps.

Thanks. I have remove that file. I guess I don’t need that code now. I believe that was for earlier version of X to remove the H1 tag… But that option is inbuilt now in X theme options.

Hi Amit,

Glad that you handled the case :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.