Getting metadata to show in widget
-
Hi,
It is my first time creating a widget. The widget shows X’s number of post from a selected category (which works fine), but It needs also to show a metadata value that I have created. Is this possible to do? My question is because it does not show. I am using the following:
$loop = new WP_Query ( 'cat='.$catid.'&showposts='.$numberposts.'' ); while ( $loop->have_posts() ): $loop->the_post(); $do_not_duplicate = $post->ID; echo '<li>'; echo '<h2><a href="'.get_permalink($post->ID).'">'.get_the_title($post->ID).'</a></h2>'; echo '<span class="publish_by">by'; echo get_post_meta($post->ID, 'author_source', true); echo '</span>'; cidd_excerpt('cidd_excerptlength_widget', 'cidd_excerptmore'); echo '<div class="clear"></div>'; echo '</li>'; endwhile; wp_reset_query(); echo '</ul></div>'; echo '</div></li>';
Any advice is welcome. Thank you in advance for the time given.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Getting metadata to show in widget’ is closed to new replies.