Skip to content

Instantly share code, notes, and snippets.

@billerickson
Created July 1, 2016 16:32
Show Gist options
  • Save billerickson/a3fbaf1d243e7a9643a717edfff540b7 to your computer and use it in GitHub Desktop.
Save billerickson/a3fbaf1d243e7a9643a717edfff540b7 to your computer and use it in GitHub Desktop.
<?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