Skip to content

Instantly share code, notes, and snippets.

@tdrayson
Last active July 6, 2022 15:42
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tdrayson/ea9111c82937d08e50febcb4abdc3345 to your computer and use it in GitHub Desktop.
Save tdrayson/ea9111c82937d08e50febcb4abdc3345 to your computer and use it in GitHub Desktop.
<?php
//Add to Advanced Scripts
add_shortcode( 'repeater_post_class', 'lit_post_class_sc' );
/**
* Shortcode for adding post classes inside Oxygen Repeater
*/
function lit_post_class_sc( $atts, $content = null ) {
$postclasses = join( ' ', get_post_class() );
return '<div class="'. $postclasses . '" />' . $content . '</div>';
}
//Add Shortcode wrapper inside repeater div element
[repeater_post_class]
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment