How to modify/extend/override a core method?

There’s already a simliar answer by toscho here. Based on this one and from a look at WP_Styles, which extends WP_Dependencies and _WP_Dependency, I can’t see a reason why it should not work: Whatever got added as extra–conditional, gets thrown in: // ~/wp-includes/class.wp-styles.php if ( isset($obj->extra[‘conditional’]) && $obj->extra[‘conditional’] ) { $tag .= “<!–[if {$obj->extra[‘conditional’]}]>\n”; $end_cond … Read more

How to add ‘class’ attribute into shortcode [audio]?

WordPress allows least three options to manipulate the code to your needs. Use a global variable that you increment with @Jevuska ‘s answer. global $my_audio_player_count; $my_audio_player_count = 0; add_filter( ‘wp_audio_shortcode_class’, ‘wpse221201_audio_shortcode_class’, 1, 1 ); function wpse221201_audio_shortcode_class( $class ) { global $my_audio_player_count; $class .= ‘ my-audio-player-‘.$my_audio_player_count++; return $class; } Remove the built-in shortcode and add your … Read more

Style the text before in single.php

using: http://codex.wordpress.org/Function_Reference/the_content#Overriding_Archive.2FSingle_Page_Behavior and the $strip_teaser parameter: http://codex.wordpress.org/Function_Reference/the_content#Usage in single.php, replace <?php the_content(); ?> with: <?php if( strpos(get_the_content(), ‘<span id=”more-‘) ) : ?> <div class=”before-more”> <?php global $more; $more=0; the_content(”); $more=1; ?> </div> <?php endif; ?> <?php the_content(”, true); ?>

Adding a class to the body_class function

Actually you just need a callback for the body_class filter. Then simply check what correlation you got between your meta data and the actual value: If it is a 1:1 correlation, you can just add the result of get_field() as new body class. Example: array( get_field( ‘mem_id’ ) ) if the mem_id meta value would … Read more