• Skip to primary navigation
  • Skip to content
  • Skip to primary sidebar
  • Skip to user navigation

PopWP

WordPress and Genesis Tutorials

  • Get Started
  • About
  • Archive
  • Services
  • Membership
  • My Account

Remove entry content on blog and archive pages in Genesis

Last Updated on July 10, 2019 Favorited: 2 times

This tutorial provides the steps to remove Entry Content and Entry Excerpts on Post Page (Home), Archives(Categories, Tags, Author and Date) and Search Result in any theme based on Genesis Framework.

<?php
//* Do NOT include the opening php tag

// Remove entry content on blog and archives.
add_action ( 'genesis_before_entry' , 'designody_remove_entry_content_archives' );
function designody_remove_entry_content_archives() {
	if (is_home() || is_archive() || is_search() )

		remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
}

or use return early function

// Remove entry content on blog and archives.
add_action ( 'genesis_before_entry' , 'designody_remove_entry_content_archives' );
function designody_remove_entry_content_archives() {

	if ( ! ( is_home() || is_archive() || is_search() )  ) {
        return;
	}
	
		remove_action( 'genesis_entry_content', 'genesis_do_post_content' );
}

and restrict this function on Custom Post Types

// Add entry content on CPTs.
add_action ( 'genesis_before_entry' , 'designody_add_entry_content_cpt' );
function designody_add_entry_content_cpt() {

	if ( ! is_post_type_archive() ) {
        return;
	}
	
		add_action( 'genesis_entry_content', 'genesis_do_post_content' );
}

 

Related Posts

  • Customize Entry Content in Genesis

Categories: Free Content, Genesis Tutorials Tags: entry content, entry excerpts

Reader Interactions

Primary Sidebar

Search

WPEngine WordPress Hosting, Perfected.

Hosting You are looking for?.
Perfect solution for small business to global enterprise.

Learn more

StudioPress Genesis Theme Framework

The No.1 Theme Provider.
Creative, SEO rich Theme for all niche projects.

Learn more

Categories

  • Free Content
  • Genesis Tutorials
  • Premium Content
  • Snippets
  • What's New?
  • WordPress Tutorials

Tag Cloud

Archive Background Section blog canvas menu center logo columns conditional tags CSS CSS Grid custom Customizer custom post type Custom Post Types custom template Custom Widget effect eNews Extended Featured Image front-page Genesis Genesis Sample header right hero section Image Background js layout left menu Logo menu Navigation Menu newsletter post page related posts responsive menu search search widget Shrinking Logo site header slide in-out Stylesheet Template Utility Bar Video Background widgets WordPress

Built with Genesis Framework + WordPress by Aryan Raj

  • Contact
  • FAQ
  • Disclaimer
  • Privacy Policy
  • Copyright Policy
  • Terms of Service