Skip to content

Instantly share code, notes, and snippets.

@billerickson
Last active January 4, 2019 04:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billerickson/89588b0a948a6e0168c9d57e6c474e47 to your computer and use it in GitHub Desktop.
Save billerickson/89588b0a948a6e0168c9d57e6c474e47 to your computer and use it in GitHub Desktop.
<?php
/**
* Display Posts Shortcode - Move image after title
* @see https://displayposts.com/2019/01/04/move-the-image-after-the-title/
*
*/
function be_dps_move_image_after_title( $output, $original_atts, $image, $title, $date, $excerpt, $inner_wrapper, $content, $class, $author, $category_display_text ) {
$output = '<' . $inner_wrapper . ' class="' . implode( ' ', $class ) . '">' . $title . $image . $date . $author . $category_display_text . $excerpt . $content . '</' . $inner_wrapper . '>';
return $output;
}
add_filter( 'display_posts_shortcode_output', 'be_dps_move_image_after_title', 10, 11 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment