Skip to content

Instantly share code, notes, and snippets.

@joshfeck
Created June 20, 2018 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joshfeck/ab7aaf8c50ca7030c32fb0da4c234c01 to your computer and use it in GitHub Desktop.
Save joshfeck/ab7aaf8c50ca7030c32fb0da4c234c01 to your computer and use it in GitHub Desktop.
Adds a shortcode to move some intro text to a new location between the first and second event in the list. Place [move_intro_text] onto the page along with the [ESPRESSO_EVENTS] shortcode. Add the following PHP code to a site specific plugin or into the child theme's functions.php file.
<?php
//* Please do NOT include the opening php tag, except of course if you're starting with a blank file
add_shortcode('move_intro_text', 'my_move_intro_text_shortcode');
function my_move_intro_text_shortcode() {
return '<script>jQuery( document ).ready(function( $ ) {
$( "article.espresso_events" ).first().after( $( "#intro-text-for-events" ) );
});</script>';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment