• Skip to main content
  • Skip to secondary menu
  • Skip to primary sidebar
  • Skip to footer
  • PSD to Genesis
  • Personalized Genesis Child Theme
  • Custom Website
  • Rainmaker
  • Genesis Customizations

Christoph Herr

Solutions For Your Online Business

  • Home
  • Articles
  • Recommendations
  • About
  • Praise
  • Contact
  • Schedule a Call

Remove empty entry-content markup with jQuery

Last updated on July 29, 2016 by Christoph Herr Leave a Comment

One of the great things about the Genesis Framework by Studiopress is that virtually everything can be changed.

Another great thing is that there are so many tutorials available on how to make those changes.

The Studiopress website provides the following code snippet to remove the entry-content from a website:

// Remove the post content
remove_action( 'genesis_entry_content', 'genesis_do_post_content' );

It does what it is supposed to do and removes all the content.

Screenshot showing that entry-content is removed

 

If you look at the HTML markup, however, you will find the following:

Screenshot showing empty entry-content markup

 

All the content is gone but our code snippet did not remove the entry-content HTML markup.

Something similar happens when entry-header and entry-footer are removed but both have hooks available to deal with the markup.

It seems a bit strange given the number and variety of all the available hooks, but it looks like there is no hook available to remove entry-content markup.

Now, it´s not like that empty markup would cause any real trouble for your website, or your website performance (think loading speed).

It´s more that it´s inelegant, unnecessary and just annoying.

So what can we do about it?

We have to leave PHP with its hooks and remove_actions behind for a moment and turn to Javascript, more precisely jQuery.

Among other things, jQuery allows quick and easy manipulations of the HTML on a website.

With a really short, single line of code, we can remove the empty entry-content markup:

$( ".entry-content" ).remove();

Really???

Really.

Remove entry-content markup Screenshot

 

The easiest way to utilize that line of code in your website is to add it to an existing .js file of your WordPress theme that is already using jQuery.

Share this:

Share on X (Twitter)Share on FacebookShare on PinterestShare on LinkedInShare on Email

Filed Under: Code Snippets

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar

Getresponse Email Marketing WordPress Speed Test

Subscribe to my newsletter

Please enter your information here:

I hate spam. Your information is save.

Latest Posts

WordPress Black Friday & Cyber Monday Deals

Once again it´s time for WordPress Black Friday & Cyber Monday Deals. Like last year, I have … [Read More...] about WordPress Black Friday & Cyber Monday Deals

Cafe Pro - sticky menu and image logo - end result

Add a logo to the sticky menu of Cafe Pro

A member of the Studiopress forum asked how to show a logo in the after header menu (primary … [Read More...] about Add a logo to the sticky menu of Cafe Pro

Smart Passive Income Pro screenshot

Remove the featured image from the homepage of Smart Passive Income Pro

Studiopress just released a new child theme for the Genesis Framework, called Smart Passive Income … [Read More...] about Remove the featured image from the homepage of Smart Passive Income Pro

Footer

StudioPress Theme of the Month

Copyright © 2025 · Magazine Pro Theme On Genesis Framework · WordPress · Log in