Created
July 1, 2016 16:32
-
-
Save billerickson/a3fbaf1d243e7a9643a717edfff540b7 to your computer and use it in GitHub Desktop.
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 | |
//---------------------------------------------------------- | |
// Display Posts Shortcode plugin: add H2 to title | |
//---------------------------------------------------------- | |
add_filter( 'display_posts_shortcode_output', 'format_dps_title', 10, 9 ); | |
function format_dps_title( $output, $original_atts, $image, $title, $date, $excerpt, $inner_wrapper, $content, $class ) { | |
// Make Title and H2 | |
$title = ' <h3>'. $title .'</h3>'; | |
// Now let's rebuild the output. | |
$output = '<' . $inner_wrapper . ' class="' . implode( ' ', $class ) . '">' . $image . $title . $date . $author . $category_display_text . $excerpt . $content . '</' . $inner_wrapper . '>'; | |
// Finally we'll return the modified output | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment