Custom Query Post
-
Hi,
Please help ??
I want to work in this one. It gets me some error in the output. I put this on the functions. It is fine.
function display_exhibitor_logo($custom_query){ $html = ''; while ( $custom_query->have_posts() ) : $custom_query->the_post(); $attr['title'] = $attr['alt'] = get_the_title(); $html .= '<li class="exhibitor-home-img"> '.get_the_post_thumbnail(get_the_ID(), 'exhibitor-img2', $attr ).'</li>'; endwhile; return $html; }
But..
I want to add a custom field that when exists, it can add a style=”display:none” to hide.
function display_exhibitor_logo($custom_query){ $html = ''; while ( $custom_query->have_posts() ) : $custom_query->the_post(); $attr['title'] = $attr['alt'] = get_the_title(); $html .= '<li class="exhibitor-home-img" '.get_post_meta($post->ID, 'checked', true) ) ? 'style="display:none"' : '').'> '.get_the_post_thumbnail(get_the_ID(), 'exhibitor-img2', $attr ).'</li>'; endwhile; return $html; }
It gives me some error in the output when I add the get post meta.
Please help.
Thanks,
Rommel
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Custom Query Post’ is closed to new replies.