WordPress Tutorials by WP101®

WordPress tutorial videos for beginners.

  • Buy Lifetime Pass
  • About WP101
    • Products We ❤️
    • Testimonials
  • WordPress Tutorials
    • WordPress 101 Course
    • WordPress 101: Classic
    • WooCommerce 101
    • Beaver Builder 101
    • Ninja Forms
    • WP Rocket 101
    • Jetpack Plugin
    • Yoast SEO
  • Help Forum
    • Hire a WordPress Expert
    • Contact Us
  • Blog
  • Log In

How to keep the <head> section and remove the space caused by the unwanted row?

WordPress Q&A Forum › How to keep the <head> section and remove the space caused by the unwanted row?
0 Vote Up Vote Down
C
Cliff Han
asked 3 years ago

I added a <head></head> section to my page and the space between header and content increased due to a row was added without my knowledge. I don’t see the row in text edit mode. It can only be seen with WPbakery Page Builder. If I remove the “empty” row, the <head></head> is gone. How to keep the <head> section and remove the space caused by the unwanted row?

1 Answers
0 Vote Up Vote Down
C
Cliff Han
answered 3 years ago

it has been solved with this: margin-top: -150px !important;

Shawn Hesketh Staff replied 3 years ago

Glad to hear you figured it out, Cliff. I wonder why you added a new “ section to your page? A webpage should only have ONE section, and that is usually included in your theme’s code. Adding a new section could cause more problems than layout… it could result in SEO issues or worse.

The correct way to add code to the section of your website is by either editing the theme code, using a function to programmatically insert code, or use a plugin like: https://wordpress.org/plugins/header-footer/

Many themes, like Genesis, also include a field within the Theme Options to add code to your site’s or section.

At any rate, I’m happy you solved the visual issue. You just may want to double-check whether or not you’ve gone about it in the correct way.

Hope this helps!

C
Cliff Han
replied 3 years ago

Hi Shawn,

I added code to track the conversion rate for an ad campaign. Do I have to use the plugin or the other way?

Cliff

Shawn Hesketh Staff replied 3 years ago

Hey Cliff,

Yeah, that’s what I suspected. So, whatever code snippet they provided to you for tracking the conversion rate needs to be [properly] added to the existing section. You don’t accomplish this by simply adding a new section to a page or post on your site.

Instead, you’ll want to add that snippet using one of the methods I suggested above.

First, check your theme options to see if there is a field for adding code snippets to your header or footer. I use a Genesis theme, which provides these fields in: Genesis > Theme Settings: https://cl.ly/1r2n0q1S0P36

If your theme does not include settings like this, you can accomplish the same thing by installing and activating a plugin like: https://wordpress.org/plugins/header-footer/

And finally, you can edit your theme files to manually add the code. BUT, that’s not the best idea, since your changes will be overwritten the next time you update your theme. Instead, I recommend one of the two methods above.

And, if you want to just hire someone to add the code snippet for you, reach out to the experts at Codeable, who are available to make small tweaks like this at very affordable rates: https://www.wp101.com/help/

Hope this helps!

C
Cliff Han
replied 3 years ago

Hi Shawn,

That is a great help.

I think the plugin insert the script into the header of all pages. It is fine for the general script. The specific event tracking script has to be in the header of a single page. Is there a way to do that.

Thanks,

C
Cliff Han
replied 3 years ago

OK, found SOGO Add Script to Individual Pages Header Footer to do the trick.

Ask a Question

Share this with someone?

FacebookTweetLinkedIn

Most Recent Questions

  • How do I add a single column image rotator? asked by Valerie andrews
  • How do I show under constuction asked by Christine Yee
  • How do I add a subscribe box? asked by Kristen Priebe
  • Will deleting a file in media library affect my post? asked by Renna Zetha
  • Do WordPress templates offer responsive design? asked by Jennifer Suess
  • How do I create multiple sites? asked by Brett Marshall
  • How do I require individual logins to my site and manage a list of users? asked by Jennifer Suess

Hire a WordPress Expert?

Need a quick fix or minor tweak to your WordPress theme? Or a custom feature for your site? Connect with 430 handpicked WordPress experts with just a click!

Chat Now

Site Links

  • About Us
  • Your Account
  • Products We ❤️
  • Affiliates
  • Testimonials
  • Blog
  • Contact Us

Courses

  • WordPress 101
  • WooCommerce
  • Beaver Builder
  • Ninja Forms
  • WP Rocket
  • Jetpack
  • Yoast SEO

Products

  • WP101.com
  • WP101 Plugin
  • Embed our videos on your site!

Connect with Us

  • Email
  • Facebook
  • Twitter
WP101 Membership Card

WordPress Tutorials by WP101© 2008-2021 WP101® LLC, Houston, TX. All rights reserved.
WP101® is a registered trademark with the U.S. Patent and Trademark Office.
Hosted by Nexcess
Privacy Policy | Terms of Use | Disclosure