• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Custom Error Message for CPT Archive Page

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › Custom Error Message for CPT Archive Page

This topic is: not resolved

Tagged: custom post types

  • This topic has 2 replies, 2 voices, and was last updated 10 years ago by brettatkin.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • June 5, 2015 at 9:14 am #154986
    brettatkin
    Member

    On the following page, I want to change the default error message ("Sorry, no content matched your criteria.") that is displayed when no published content is available.

    http://fcr.betaforming.com/classifieds/

    This is a super simple Classifieds section using custom post types and a custom archive page. When the site launches, there won't be any classifieds to display and want to changed the error message to say something like "Be the first to place a classified ad"...

    Ideally, I'm only changing the error message for this archive page.

    How do I do this?

    Thanks

    Brett

    http://fcr.betaforming.com/classifieds/
    June 5, 2015 at 11:03 am #155000
    Erik D. Slater
    Member

    This might help get you on your way:

    // Replace "Sorry, no content matched your criteria." message
    remove_action('genesis_loop_else', 'genesis_do_noposts');
    add_action('genesis_loop_else', 'eds_genesis_loop_else', 10, 0);
    function eds_genesis_loop_else()
    {
    	echo YOUR GROOVY NO-POSTS MESSAGE HERE ...
    }
    

    Erik D. Slater: Digital Platform Consultant • LinkedIn
    June 5, 2015 at 1:31 pm #155019
    brettatkin
    Member

    Worked perfectly, thanks!

    Brett

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble