• Skip to primary navigation
  • Skip to main content

Genesis Community

Resources for Genesis WordPress Theme Users

  • Facebook
  • Twitter
  • Slack
  • Wiki
  • Login
You are here: Home / Wikis / Genesis / Customize Genesis No Posts Output

Customize Genesis No Posts Output

// Replace No Posts loop structure
remove_action( 'genesis_loop_else', 'genesis_do_noposts' );
add_action( 'genesis_loop_else', 'prefix_alter_no_posts_output' );
function prefix_alter_no_posts_output() {

     // Output no post content and structure
     echo '<div class="entry"><div class="entry-content">';

     printf( '<p class="no-posts-message">%s</p>', apply_filters( 'genesis_noposts_text', __( 'Sorry, no content matched your criteria.', 'genesis' ) ) );

     // Add widget area if needed

     echo '</div></div><!-- End of No Posts -->';

}
Notes:

genesis_loop_else() doesn't allow for a lot of customization outside the genesis_noposts_text() filter for altering the on page message. If you want to change the structure or wish to add a widget area within the content area the easiest thing to do is remove it and add it back in with your modifications. The genesis_noposts_text() filter is still accessible with this approach. Find the source within Genesis > lib > structure > post.php

Posted by: Patrick Boehner Category: Genesis

« Remove Genesis In-Post Settings
Remove Genesis Admin Metaboxes and Customizer Settings »

Copyright © 2026 · Genesis Sample on Genesis Framework · WordPress · Log in