Created
February 23, 2016 16:24
-
-
Save kraftbj/b65a429e6efef9984b07 to your computer and use it in GitHub Desktop.
Insert generic related posts when none returned
This file contains hidden or 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( 'jetpack_relatedposts_filter_hits', 'kraft_add_default_posts' ); | |
| function kraft_add_default_posts( $ids ) { | |
| if ( empty( $ids ) ){ | |
| $ids = array( 123, 456, 789 ); | |
| } | |
| return $ids; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment