Shortcode not rendering HTML
-
I’m developing my first plugin and the shortcode is not rendering the output, instead I get the name of shortcode in square brackets.
function easyit_travel_shortcode($atts, $content = NULL){ $atts=shortcode_atts(array( 'title'=>'Travel List', 'count'=>10, 'category'=>'all' ),$atts); if($atts['category']=='all'){ $terms=''; }else{ $terms=array( array( 'taxonomy'=>'category', 'fiels' =>'slug', 'terms' =>$atts['category'] ) ); } $args=array( 'post_type'=>'travels', 'post_status'=>'publish', 'orderby' =>'due_date', 'order' =>'ASC', 'posts_per_page'=>$atts['count'], 'tax_query' =>$terms ); $travels=new WPQuery($args); $output=""; if($travels->have_posts()){ $travels->the_post(); $start_input=get_post_meta($post->ID,'start_input',true); $end_input=get_post_meta($post->ID,'end_input',true); $datepicker=get_post_meta($post->ID,'datepicker',true); $output.="<ul>"; $output.="<li>".$start_input."</li>"; $output.="</ul>"; return $output; } } add_shortcode('travels','easyit_travel_shortcode');
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Shortcode not rendering HTML’ is closed to new replies.