Blank lines in source

I’ve searched for a solution to this to no avail. I have five blank lines of code in my source above Doctype. We use the Yoast SEO plugin, and this can cause errors in the sitemap XML. Has anyone been able to remove these blank lines?

Hi,

I will forward this to our web development team for review.

For the mean time, to remove it you have to copy all these files to your child theme on the same path as it is on the main theme.

wp-content/themes/x/framework/legacy/cranium/headers/views/header/base.php
wp-content/themes/x/framework/legacy/cranium/headers/views/global/_header.php
wp-content/themes/x/index.php
wp-content/themes/x/header.php
wp-content/themes/x/framework/views/{STACK}/wp-index.php
wp-content/themes/x/framework/legacy/cranium/headers/views/{STACK}/wp-header.php

to your child theme

wp-content/themes/x-child/framework/legacy/cranium/headers/views/header/base.php
wp-content/themes/x-child/framework/legacy/cranium/headers/views/global/_header.php
wp-content/themes/x-child/index.php
wp-content/themes/x-child/header.php
wp-content/themes/x-child/framework/views/{STACK}/wp-index.php
wp-content/themes/x-child/framework/legacy/cranium/headers/views/{STACK}/wp-header.php

Then remove the empty line after the first ?>

For example for wp-header.php

Change this

<?php

// =============================================================================
// VIEWS/INTEGRITY/WP-HEADER.PHP
// -----------------------------------------------------------------------------
// Header output for Integrity.
// =============================================================================

?>

<?php x_get_view( 'global', '_header' ); ?>

to this

<?php

// =============================================================================
// VIEWS/INTEGRITY/WP-HEADER.PHP
// -----------------------------------------------------------------------------
// Header output for Integrity.
// =============================================================================

?>
<?php x_get_view( 'global', '_header' ); ?>

Hope that helps

@paul.r, thank you! I copied over those files and made the edits, and it got rid of all but 2 blank lines. Are there any other files that should be brought over and edited?

Thanks!

John

Hello John,

Please check the main header as well. Please follow the following steps below:
1] Using Notepad or TextEdit or Sublime Text or any text editor, please create a new file in your local machine.
2] Insert the following code into that new file

<?php

// =============================================================================
// VIEWS/HEADER/BASE.PHP
// -----------------------------------------------------------------------------
// Declares the DOCTYPE for the site, includes the <head>, opens the <body>
// element as well as the .x-root <div> and .x-site <div>.
// =============================================================================

$x_root_atts = x_atts( apply_filters( 'x_root_atts', array( 'id' => 'x-root', 'class' => 'x-root' ) ) );
$x_site_atts = x_atts( apply_filters( 'x_site_atts', array( 'id' => 'x-site', 'class' => 'x-site site' ) ) );

?>
<!DOCTYPE html>
<html class="no-js" <?php language_attributes(); ?>>
<head>
  <?php wp_head(); ?>
</head>

<body <?php body_class(); ?>>

  <div <?php echo $x_root_atts; ?>>

    <?php do_action( 'x_before_site_begin' ); ?>

    <div <?php echo $x_site_atts; ?>>

    <?php do_action( 'x_after_site_begin' ); ?>

3] Save the file named as base.php
4] Upload this file to your server in the child theme’s folder wp-content/themes/x-child/framework/views/header/

You may need to create the folder path because it does not exist yet in the child theme.

Hope this helps. Please let us know how it goes.

Hello @RueNel!

I did as you instructed, but it still shows two blank lines at the top: http://www.braininjurylawofseattle.com.

If you have any other insight, I’m all ears. Thanks!

John

Hey John,

We give you pretty much of the files that needs changes. The sitemap should have worked too.
http://www.braininjurylawofseattle.com/sitemap_index.xml

Would you mind providing us access to your site? We might find something in the settings or in the child theme files.

Thank you in advance.

@RueNel,

It looks like the sitemap is indeed working. No need to keep digging, I’ll work on it. Thanks for your help!

John

Glad we were able to help :slight_smile:

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