Skip to content

Instantly share code, notes, and snippets.

@damiencarbery
Created April 18, 2025 14:10
Show Gist options
  • Save damiencarbery/ef44e6171f05f52f8428651439d51328 to your computer and use it in GitHub Desktop.
Save damiencarbery/ef44e6171f05f52f8428651439d51328 to your computer and use it in GitHub Desktop.
add_filter( 'vc_shortcode_output', 'do_recent_posts_autoplay', 10, 4 );
function do_recent_posts_autoplay( $output, $vc_class, $prepared_atts, $shortcode ) {
if ( 'recent_posts' == $shortcode ) {
return str_replace( 'data-height="600"', 'data-flickity=\'{ "setGallerySize": false, "autoPlay": true }\' data-height="400"', $output );
}
return $output;
}
/* Hide the 'Read Article' text. */
.home .recent-post-container .nectar-button span { font-size: 0 !important; }
/* Replace it with 'View Item' text. */
.home .recent-post-container .nectar-button span::after { content: 'View item'; font-size: 11px !important; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment