[Plugin: Events Manager] Choose a color for a category
-
Hello!
I choose a color for a category, but where the color is supposed to display.
I thought the color would display in the widegt’s calendar.
Regards
-
you can use placeholders e.g. #_CATEGORYCOLOR
I’m sorry but I really don’t know where to use the placeholder #_CATEGORYCOLOR so that the cell in the mini calendar get the color defined in the categories settings.
The ideal would be to have a legend below the mini-calendar with the colors and their corresponding categories.
Any way to do that,
RegardsIf you want to use it in the calendar then you could customize the calendar template and use the placeholder.
http://wp-events-plugin.com/documentation/
http://wp-events-plugin.com/tutorials/
http://wp-events-plugin.com/documentation/using-template-files/I can’t figure this out either! Would you be able to show us how to use #_CATEGORYCOLOR in the small calendar?
Thank you thank you!
within your formats, if you make an element e.g.
<div style="background:#_CATEGORYCOLOR;">...
Thanks Marcus. I’m just not sure where to put it? The small calendar in formats only allows for a title field and a separator. I would like to add the category color to the background of the day the event is on, on the small calendar…
Thank you
for that you’d have to edit the calendar template php file itself, which would require some php skills
it’s located within templates/templates/calendar-small.php
if you copy that to yourcurrentthemefolder/plugins/events-manager/templates it’ll override the default one.
Thanks for your help Marcus! I think this might be a little out of my php league π
Hi Marcus,
I posted this question elsewhere, but am hoping by posting here, it will get a response?
I’ve followed your instructions, as best I could, templates/templates/calendar-small.php, I’ve edited the following copy:
<a href="<?php echo esc_url($cell_data['link']); ?>" title="<?php echo esc_attr($cell_data['link_title']); ?>" style="color:#_CATEGORYCOLOR;"><?php echo date('j',$cell_data['date']); ?></a>
To read:
<a href="<?php echo esc_url($cell_data['link']); ?>" title="<?php echo esc_attr($cell_data['link_title']); ?>" style="color:#_CATEGORYCOLOR;"><?php echo date('j',$cell_data['date']); ?></a>
But so far can still only see orange as color displayed for events, despite having 3 catogries with different categories and the events listed belonging exclusively to one of the 3 categories.
My site is: http://abbyravera.com/romeing/ and you can see the small calendar displayed towards the top of the page.
Thank you so much for your help. hoping you can help!
I have the same question as sohum; I’d like an answer to his question too.
you can try something like
Put this above the file ->
global $EM_Event;
style="color:<?php echo $EM_Event->output("#_CATEGORYCOLOR"); ?>"
Hi agelonwl,
Thanks for your help!
I tried to give your advice a shot, but think perhaps I placed the suggested code incorrectly because I’m still not seeing individual category colors showing on the small calendar…
I’m also confused: should this not happen automatically (if you’re asked to enter category colors during the category creation stage, shouldn’t this show automatically)?
The code for my calendar-small.php file looks like this:
[Code moderated as per the Forum Rules. The maximum number of lines of code that you can post in these forums is ten lines. Please use the pastebin]
Hoping there’s something really small and silly that I’m missing π
Thanks again for your help!
I might be able to help and so might be able to clarify the discussion.
I was trying to do the same thing as sohum, with no success, but with the following two exceptions:
1. I was trying to edit the full calendar, not the small calendar
2. I was trying to change the font (link) color, not the backgroundAt first I tried editing in Settings/Formats/Calendar, (Full calendar events format) but I must have been putting the wrong code in because I got nothing. So I tried to edit the template file and had the same results as sohum.
I put this
<li><a style="color:#_CATEGORYCOLOR;" href="#_EVENTURL">#_EVENTNAME</a></li>
in the aforementioned field and got the right results.Anyways, I think the settings on the format page might be overriding the template edits, so perhaps if you add similar formatting to Small calendar title that might help. Otherwise there might be a bug…
can you paste again your template code?
I want the same result as you.
In which field did you put that code?
- The topic ‘[Plugin: Events Manager] Choose a color for a category’ is closed to new replies.