Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter seven7htangent

    (@seven7htangent)

    Figured it out!

    /**
    * [upcoming_events] Shortcode
    */
    
    function showUpcomingEvents($atts) {
    	$tomorrow = mktime(0, 0, 0, date("m"), date("d")-1, date("y"));
    	$curstamp = date('Ymd', $tomorrow);
    	extract( shortcode_atts( array(
    		'limit' => '',
    		'orderby' => 'date',
    		'tags' => ''
    	), $atts ));
    
    // Don't hide events events without tags
    	if ($tags != '') {
    		$withtag = array(
    	        array(
    	            'taxonomy' => 'tags',
    	            'field' => 'slug',
    	            'terms' => $tags
    	        )
    	    ); }
    
    	// Create custom query to fetch the custom post.
    	$loop = new WP_Query(array(
    		'ID' => 'post_id',
    		'post_type' => 'beat_event',
    		'posts_per_page' => $limit,
    		'orderby' => 'meta_value_num',
    		'meta_key' => 'date_stamp',
    		'meta_value' => $curstamp,
    		'meta_compare' => '>=',
    		'tax_query' => $withtag,
    		'order' => 'ASC'));
    
    	// Loop through the posts and create the HTML structure
    	if($loop){
    		while ($loop->have_posts()){
    			$loop->the_post();
    
    			$event_date = get_post_meta(get_the_id(), "date_display", true);
    			$cost = get_post_meta(get_the_id(), "cost", true);
    			$pic_url = get_post_meta(get_the_id(), "picture", true);
    
    			$output .= '<article id="post-'.get_the_ID().'" class="post type-post status-publish format-standard hentry clearfix event">';
    			if ($pic_url != '') {
    				$output .= '<figure class="post-image left"><img src=\''.$pic_url.'\' alt=\''.get_the_title().'\' /></figure>';
    			}
    			$output .= '<div class="post-content"><time datetime="YYYY-MM-DD" class="post-date" pubdate>'.$event_date.'</time>';
    			$output .= '<h1 class="post-title"><a href="'.get_permalink().'" title="'.get_the_title().'">'.get_the_title().'</a></h1><p>'.get_the_excerpt().'</p></div></article>';
    		}
    	}
    	else
    		$output = 'No events are scheduled at this time. Please check back soon, or join our mailing list.';
    	// Output the HTML where the shortcode was called
    	return $output;
    }
    
    add_shortcode('upcoming_events','showUpcomingEvents');
    Forum: Plugins
    In reply to: wooCommerce Shipping error

    In short, there’s a bug in WooCommerce that causes the “Sorry, it seems that there are no available shipping methods for your location…” error. Until they fix the bug, setting the ‘Cost’ option to anything but 0 in Flat Rate and International Delivery is an effective workaround.

Viewing 2 replies - 1 through 2 (of 2 total)