[Resolved] [Plugin: Events Manager] Cannot figure howto user category colors in calendar-small.php file
Well this is mind boggling. I am using latest version of Events Manager and I am trying to deploy this plugin to my customer who has this simple request; category colors should be used as a table-cell background color in widget calendar (calendar-small.php).
After I’ve tried possible every trick that there is in this forum, I am starting to believe that this cannot be solved with another cup of hot coffee. I need some advices… please…
What I have done so far:
I have copied this calendar-small.php to my template folder as mentioned in tutorials – I confirmed that with simple echo and to make sure that I am using right file.
Then I tried just simple edit <td…> line and added:
<td class="<?php echo $class;?>" style="background-color: #_CATEGORYCOLOR;">
and I end up with this:
<td class=”eventful” style=”background-color: #_CATEGORYCOLOR;”>
So that didn’t work and obviously shortcodes are not mentioned to use inside PHP templates?
SO – Next idea was promising …
I added this:
to first <?php ?> part and then modified the same <td…> line as follows:
<td class="eventful" style="background-color:<?php echo $EM_Event->output("#_CATEGORYCOLOR"); ?>">
which gives me this:
<b>Fatal error</b>: Call to a member function output() on a non-object in <b>/biz/0/teams/html/www/wp-content/themes/twentyten/plugins/events-manager/templates/calendar-small.php</b> on line <b>38</b>
I have also tried to get the category ID out of the $cell_data but my PHP skills are not there yet.. When I print_r() it, I see that it is there, but I cannot figure out the corrent $cell_data… combination to get it out. 🙁 I could use that ID to create CSS classes for every category that we are using.
Any ideas, how I can use category color (or image) as a background in small calendar is welcome…
- The topic ‘[Resolved] [Plugin: Events Manager] Cannot figure howto user category colors in calendar-small.php file’ is closed to new replies.