Created
March 6, 2020 03:33
-
-
Save wplit/e03023b6e19d169b0be4748951d20f2c to your computer and use it in GitHub Desktop.
Post ID in repeaters
This file contains hidden or 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
| add_shortcode( 'repeater_post_id', 'lit_post_class_sc' ); | |
| /** | |
| * Shortcode for adding post classes inside Oxygen Repeater | |
| */ | |
| function repeater_post_id( $atts, $content = null ) { | |
| $post_id = get_the_id(); | |
| return '<div id="prefix-'. $post_id . '" />' . $content . '</div>'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment