Support » Plugin: Editorial Calendar » [Plugin: Editorial Calendar] Showing Category instead of Time

  • Resolved totchers


    Hello! This is a great plugin which I would love to use. However for my purposes (class planning) it is essential that I see the category in the calendar.

    What can I switch the “post.formattedtime” with to show the post category instead? This is from edcal.js

    if (edcal.timePref) {
    posttitle = ‘<span class=”posttime”>’ + post.formattedtime + ‘</span> ‘ + posttitle;

    Thank you very much!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Zack Grossbart


    Thanks for using the Editorial Calendar.

    That section of edcal.js can show different data that we get back from the server, but we don’t return post categories from the server in this case. If you want to see post categories in the calendar it will take a larger change to the edcal.php and then edcal.js.

    By the way, we kept categories out of the calendar since they can get pretty long the there isn’t much space to show them.

    Good luck,

    Having some way to show the categories for each post would be REALLY helpful. It would enable one to look at your calendar and to get a feel for how many posts you have in each category.

    This could be done with coloring, or just the first letter of each category, or first distinct letter, etc.

    Plugin Author Zack Grossbart


    Thanks for the awesome feedback. We’ve always shied away from showing categories in the calendar because of the space. Some people use a single category for each post, but others use multiple categories and there just isn’t space in the calendar.

    Any ideas for how we should show multiple categories or handle the spacing issues?


    Have an option to dis/enable this display categories feature. Option is off by default, so the calendar continues operating just as it does now. (Not sure if that option could be in the “screen options” at the top of the calendar’s display, or if that has to somewhere away in a true settings area.) Then, if it’s on . . .

    Compose a distinct marker for each category. (I’m thinking something you can whip up within the calendar’s display code — not something that you have add as a feature/option on each category.) Take the first letter of each category; If you get to a category and the first letter was already seen, then use the second letter. (or maybe you only use consonants.)

    So we have “N” for my “news” category, “P” for my “parsnips” category, and “E”, (second letter,) or “L”, (if using next available consonant,) for my “people” category. Each post’s category letters are added to the display; I’m thinking between the time and the title. I’d prefer the markers presented with a little color-filled box around the letter. Just pick a pallette of muted colors that are simply assigned in order to the markers. (Maybe an option for ‘use colors’ versus ‘use gray shades’.)

    Now I can view 8 weeks at a time… and I can see “N”, “P” and “E” posts. At a glance I can even see how much red (eg, if N’s are on a red-filled little box), how much blue (“P”), etc. So I can get a feel for the categorical balance of what’s going on in my calendar.

    If people have too many categories on each post, (in their opinion when they flip the option on,) it will be a mess. So for such use cases can just leave the option off — they don’t have the feature as-is anyway. I think many use cases though have one or two categories per post.

    UNRELATED: ¿ An option to limit the lengths of the titles displayed ? Just a “truncate titles” to a specified number of characters. That would let the power users save some space. too.

    How about just a category / tag filter ? so that we can show posts that are ONLY of a particular tag / category?

    Another easy option would be to assign colors to each category, and assign that background color to the calendar post item

    Another could be in the Screen Options dropdown, to have a checkmark for each category you want displayed…

    There would need to be considerations for blogs that have tons of categories / tags ( I use about 10 categories and more than 100 tags ), and some tag/category names are really long ( I too am opposed to them showing as a name in the calendar ).

    Anyhow, just my 2 cents on how to add categories into the calendar…

    Here’s a quick hack in the PHP file. It alters each post’s title, before it is JSON encoded and sent back as the AJAX response.

    This adds a small “(ABC/format)” string in front of each title. It includes the first letter of each category the post is in, and then shows the post type.

    In the plugin’s only “.php” file, locate the edcal_post() function, and add this inside the for() loop which does the JSON encoding:

    for($i = 0; $i < $size; $i++) {
                $post = $myposts[$i];
    /* HACK
     *  adds "(AB/quote) " to front of post's title. The letters
     *  before the slash are the first character of the categories,
     *  the post format is after the slash.
    $post_categories = wp_get_post_categories( $post->ID );
    $cats = '';
    $cats_long = '';
    foreach ( $post_categories as $c ) {
      $cat = get_category( $c );
      $cats .= strtoupper(substr($cat->name,0,1));
    $format = get_post_format($post->ID);
    $about = '(' .($cats ? $cats : '') .($format ? '/'.$format : '') .') ';
    $post->post_title = $about .$post->post_title;
    /* end of HACK */
                $this->edcal_postJSON($post, $i < $size - 1);

    Thanks, cconstantine!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Plugin: Editorial Calendar] Showing Category instead of Time’ is closed to new replies.