Shortcode Help – List Custom Post Type Posts
-
I have the following code in my functions.php. I have two problems.
1. The post titles are out putted correctly but they appear before the widget area not inside it.
2. The post meta for “workshops_1_date_of_event_label” isn’t showing up.Thanks in advance for any help you can provide.
function upcoming_workshops() { $args = array('post_type' => 'workshops', 'meta_key'=>'workshops_1_start_date', 'orderby' => 'meta_value', 'order' => 'ASC' ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); ?> <a href="<?php the_permalink(); ?>" > <article id="post-<?php the_ID(); ?>" class="workshop-sidebar-item"> <?php //$workshop_date = get_post_meta($post->ID, 'workshops_1_date_of_event_label', true); echo "<span class='title' >"; the_title(); echo "</span>"; echo "<br />"; echo "<span class='date' >"; //echo $workshop_date[1][1]; echo "</span>"; ?> </article><!-- #post-## --> </a> <?php endwhile;?> <?php wp_reset_postdata(); }
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Shortcode Help – List Custom Post Type Posts’ is closed to new replies.