Home Forums Theme support Lambada – specific classes by instructor Reply To: Lambada – specific classes by instructor

Hi,

the shortcode is our and it was made to show the classes for the instructor on their pages.

I think when you copy and modify the shortcode it should be possible to do that. You can try to add the following code to your functions.php file (It’s not tested but it should work, shortcode is [classes_boxes]):

function sl_get_classes_boxes( $atts, $content=null ) 
	{
	extract(shortcode_atts(array(   
		'items'=>'999',
	    ), $atts)); 
	global $wpdb;
    
	$wcs3_settings = wcs3_load_settings();    
	$format = ( $wcs3_settings['24_hour_mode'] == 'yes' ) ? 'G:i' : 'g:i a';        
	$table = wcs3_get_table_name(); 
    
	$query = "SELECT * FROM $table ORDER BY weekday LIMIT $items ";   
     
	$class = get_post( $class_id )->post_title; 
	$weekdays_dict = wcs3_get_weekdays();    
    
	$r = $wpdb->get_results( $wpdb->prepare( $query, $query_arr ) );
    
	if ( !empty( $r ) ) 
		{
		$i=0;
		$return="<ul class='instructor_classes_list'>";
		foreach ( $r as $entry ) 
			{ 
			$day = $weekdays_dict[$entry->weekday]; 
			$return.= "<li><i class='fa_icon icon-clock-o classes_icon'></i><span class='classes_list_class'>";
			$return.="<a href='".get_permalink( $entry->class_id )."'>";
			$return.=get_post( $entry->class_id )->post_title;
			$return.="</a></span>";
			$return.=$day.", ".date( $format, strtotime( $entry->start_hour ) )." - ".date( $format, strtotime( $entry->end_hour ) )."</li>";
        			}
		$return.="</ul><div class='clear'></div>";
		}
	return $return; 
	}
add_shortcode('classes_boxes', 'sl_get_classes_boxes');