Home Forums Theme support Lambada – specific classes by instructor

This topic contains 1 reply, has 2 voices, and was last updated by  7Theme Support 5 years, 3 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • Hi,

    I am looking to implement a view of specific classes for the instructor page. I am not sure if [get_classes] shortcode is yours or by WCS, but maybe you know how to do it, worth a shot.
    [wcs class=”NAME OF CLASS”] shows it as a schedule view, not as nice boxes (see your own democontent for any instructor), that’s why I’m not sure if [get_classes] shortcode is even by WCS or you.

    If it’s yours is there a way to show it like [get_classes=”NAME OF CLASS”]?

    Thank you in advance

    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');
Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.