Last active
January 4, 2019 02:16
-
-
Save billerickson/1270278 to your computer and use it in GitHub Desktop.
Customize outer markup of Display Posts Shortcode
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 | |
/** | |
* Customize opening outer markup of Display Posts Shortcode | |
* @see https://displayposts.com/2019/01/04/use-section-element-for-wrapper/ | |
* | |
* @param $output string, the original opening markup | |
* @return $output string, the modified opening markup | |
*/ | |
function be_display_posts_open( $output, $atts, $query ) { | |
$output = '<section class="display-posts-listing">'; | |
return $output; | |
} | |
add_filter( 'display_posts_shortcode_wrapper_open', 'be_display_posts_open', 10, 3 ); | |
/** | |
* Customize closing outer markup of Display Posts Shortcode | |
* @see https://displayposts.com/2019/01/04/use-section-element-for-wrapper/ | |
* | |
* @param $output string, the original closing markup | |
* @return $output string, the modified closing markup | |
*/ | |
function be_display_posts_close( $output, $atts, $query ) { | |
$output = '</section>'; | |
return $output; | |
} | |
add_filter( 'display_posts_shortcode_wrapper_close', 'be_display_posts_close', 10, 3 ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment