';
//$classes = $content_select . ' ' . $classes;
$output ='
';
if ( $title || $sub_title ) {
$output .='
';
if ( '' !== $title ) {
$output .='
' . wp_kses_post( $title ) . '
';
}
if ( $sub_title ) {
$output .='
' . wp_kses_post( $sub_title ) . '
';
}
$output .='
';
}
$output .='
';
//$classes = $content_select . ' ' . $layout;
// Select content
if ( 'demo' === $content_select ) {
$output .= audioman_demo_events();
} elseif ( 'post' === $content_select || 'page' === $content_select || 'category' === $content_select ) {
$output .= audioman_post_page_category_events();
} elseif ( 'custom' === $content_select ) {
$output .= audioman_custom_events();
}
$target = get_theme_mod( 'audioman_events_target' ) ? '_blank': '_self';
$link = get_theme_mod( 'audioman_events_link', '#' );
$text = get_theme_mod( 'audioman_events_text', esc_html__( 'View More', 'audioman' ) );
$output .='
';
if ( $text ) {
$output .= '
' . esc_html( $text ) . '
';
}
$output .='
';
echo $output;
}
}
endif;
if ( ! function_exists( 'audioman_demo_events' ) ) :
/**
* Display Demo Events
*
* @since Audioman 1.0
*
*/
function audioman_demo_events() {
return '
';
if ( ! get_theme_mod( 'audioman_events_hide_date' ) ) {
$event_date_day = get_the_date( 'j' );
$event_date_month = get_the_date( 'M' );
$event_date_day_meta = get_post_meta( $post->ID, 'audioman-event-date-day', true );
$event_date_month_meta = get_post_meta( $post->ID, 'audioman-event-date-month', true );
if ( '' !== $event_date_day_meta ) {
$event_date_day = $event_date_day_meta;
}
if ( '' !== $event_date_month_meta ) {
$event_date_month = $event_date_month_meta;
}
$output .= '
';
}
$output .= '
';
if ( get_theme_mod( 'audioman_events_enable_title' ) ) {
$output .= '
' . the_title( '','', false ) . '
';
}
$content = apply_filters( 'the_content', get_the_content() );
$content = str_replace( ']]>', ']]>', $content );
$output .= '
' . wp_kses_post( $content ) . '
';
$output .= '
';
$text = get_theme_mod( 'audioman_events_individual_text_' . absint( $loop->current_post + 1 ) );
$output .= '
' . esc_html( $text ) . '
';
} //endwhile
wp_reset_postdata();
return $output;
}
endif; // audioman_post_page_category_events
if ( ! function_exists( 'audioman_custom_events' ) ) :
/**
* Display Custom Events
*
* @since Audioman 1.0
*/
function audioman_custom_events() {
$quantity = get_theme_mod( 'audioman_events_number', 4 );
$output = '';
for ( $i = 1; $i <= $quantity; $i++ ) {
$target = get_theme_mod( 'audioman_events_target_' . $i ) ? '_blank' : '_self';
$link = get_theme_mod( 'audioman_events_link_' . $i, '#' );
//support qTranslate plugin
if ( function_exists( 'qtrans_convertURL' ) ) {
$link = qtrans_convertURL( $link );
}
$title = get_theme_mod( 'audioman_events_title_' . $i );
if ( class_exists( 'Polylang' ) ) {
$title = pll__( $title );
}
$date_day = get_theme_mod( 'audioman_events_date_day_' . $i );
$date_month = get_theme_mod( 'audioman_events_date_month_' . $i );
if ( $date_month ) {
// Convert 1 to Jan, 2 to Feb and so on
$date_month = date( 'M', mktime(0, 0, 0, $date_month, 10 ) );
}
$output .= '
';
if ( $date_day || $date_month ) {
$output .= '
';
}
$content = get_theme_mod( 'audioman_events_content_' . $i );
if ( $title || $content ) {
$output .= '
';
}
if ( $title ) {
$output .= '
' . wp_kses_post( $title ) . '
';
}
if ( $content ) {
$output .= '
';
}
if ( $title || $content ) {
$output .= '
';
}
$text = get_theme_mod( 'audioman_events_individual_text_' . $i );
if ( $text ) {
$output .= '
' . esc_html( $text ) . '';
}
$output .= '
';
}
return $output;
}
endif; //audioman_custom_events