aaronblomberg
Forum Replies Created
Viewing 2 replies - 1 through 2 (of 2 total)
-
Forum: Plugins
In reply to: [Custom Post Type UI] Adding different classes to custom post typeHi Michael,
Just wanted to let you know this is what ended up working for me:
<?php $custom_post_type = 'chamber-news'; $args=array( 'post_type' => $custom_post_type, 'post_status' => 'publish', 'posts_per_page' => 5, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { // echo 'List of Chamber News'; while ($my_query->have_posts()) : $my_query->the_post(); ?> <ul class="chamber-news-preview"> <li class="<?php echo get_post_meta($post->ID, 'chamber-news-icon', true); ?>"> <?php the_content(); ?> </li> </ul> <?php endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?>Thanks for your help!
Forum: Plugins
In reply to: [Custom Post Type UI] Adding different classes to custom post typethanks Michael – I gave that a shot but to no avail… On the custom post itself in the custom fields i added a name of “chamber-news-icon” and a value of “community”. In the page template itself i added that to the < li > here:
<?php $custom_post_type = 'chamber-news'; $args=array( 'post_type' => $custom_post_type, 'post_status' => 'publish', 'posts_per_page' => 5, 'caller_get_posts'=> 1 ); $my_query = null; $my_query = new WP_Query($args); if( $my_query->have_posts() ) { // echo 'List of Chamber News'; while ($my_query->have_posts()) : $my_query->the_post(); ?> <ul class="chamber-news-preview"> <li class="<?php get_post_meta($postid, 'chamber-news-icon', true); ?>"> <?php the_content(); ?> <?php endwhile; } wp_reset_query(); // Restore global post data stomped by the_post(). ?>unfortuantely, the result just returns:
<li class="">any further insight would be GREATLY appreciated. thank you SO much!!
Viewing 2 replies - 1 through 2 (of 2 total)