how to conditionally add an image to events in a list
-
Hello,
I am trying to add a “hot” icon next to the #_EVENTLINK in the events list based on if that event has 4 or more ‘votes’ which I get from another plugin.
the voting mechanism is on the single event page
I rewrote some functions in the voting plugin to display a hot icon
with the shortcode “[hotornot]”my problem is that event lists do not accept shortcode am I going about this the wrong way or is there a way to include this into the events list format?
this is what I have on my template page.
echo EM_Events::output(array('format'=> ' <div id="list2"> <ul></br> <HR> </br> <div style="float:left" margin-right:10px;"> #_CONTACTAVATAR</div> <div style="float:left"; margin-left:-15px;"><em>#_EVENTLINK </em></div> <a href="#_EVENTURL"> <?php do_shortcode( "[hotornot]" ) ; ?> </a> </br> <div style="margin-left:-15px;"> <li> <p> <em> #_LOCATIONLINK </em> #_LOCATIONTOWN </p></li> </div> <p><fb:like send="true" layout="button_count" width="150" show_faces="false" href="#_EVENTURL" ></fb:like> <a href="https://twitter.com/share">Tweet</a> </p> #_EVENTIMAGE{500,125} <HR> </ul> </div> ', 'limit'=>6, 'pagination'=>1,'scope'=>'month', 'orderby'=>'event_start_date'));
This is my voting short code (which works on a single event page)
if(!function_exists('hot_or_not_shortcode')){ function hot_or_not_shortcode($atts){ global $post; return hot_or_not_display($post->ID); } add_shortcode('hotornot', 'hot_or_not_shortcode'); }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘how to conditionally add an image to events in a list’ is closed to new replies.