Skip to content

Instantly share code, notes, and snippets.

@macbookandrew
Last active August 29, 2015 14:05
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 macbookandrew/eb65e65637d26e32a0f4 to your computer and use it in GitHub Desktop.
Save macbookandrew/eb65e65637d26e32a0f4 to your computer and use it in GitHub Desktop.
WP for Church - Church Pack Pro Events - show six months at a time
/* add this below line 146 */
#church-pack .calentries {
margin-bottom: 60px;
}
// Add this line below line 106
// Shortcode to embed upcoming events calendar
add_shortcode('upcoming_events', 'wpfc_display_upcoming_events_shortcode');
function wpfc_display_upcoming_events_shortcode($atts) {
ob_start(); ?>
<div id="church-pack" class="calselect">
<?php
for ($i = 0; $i <= 5; $i++) {
$month = date( 'n' ) + $i;
if ($month <= 12) {
$year = date( 'Y' );
} else {
$month = $month - 12;
$year = date ( 'Y' ) + 1;
}
?>
<div class="calHead">
<h2 class="event-month"><?php echo wpfc_monthname( $month , $year ); ?></h2>
</div>
<div class="calentries"><?php echo wpfc_get_the_calendar( $month , $year ); ?></div>
<?php }
?>
</div>
<?php
$buffer = ob_get_clean();
return $buffer;
}
// End Shortcode
@macbookandrew
Copy link
Author

added a shortcode upcoming_events to show 6 month’s worth of events rather than just one

@macbookandrew
Copy link
Author

removed navigation to next/previous month from month header

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment