-
-
Save billerickson/98e448f85b542740b58e522dd79cbfcf to your computer and use it in GitHub Desktop.
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 | |
/** | |
* Display Posts Shortcode - "current" class on current post | |
* | |
*/ | |
function be_dps_current_class( $classes ) { | |
if( get_the_ID() == get_queried_object_id() ) | |
$classes[] = 'current'; | |
return $classes; | |
} | |
add_filter( 'display_posts_shortcode_post_class', 'be_dps_current_class' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment