-
-
Save sambody/5869806 to your computer and use it in GitHub Desktop.
WP: Display message if no results in category
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'display_posts_shortcode_no_results', 'be_no_results' ); | |
/** | |
* Display Posts Shortcode - Display message if no results | |
* | |
* @author Bill Erickson | |
* @link http://www.billerickson.net/code/display-posts-shortcode-no-results | |
* | |
* @param string $output, default is empty | |
* @return string $output | |
*/ | |
function be_no_results( $output ) { | |
$output = '<p>Sorry, there are currently no posts in this category.</p>'; | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment