WP-Cat2Calendar

WP-Cat2Calendar is a plugin which can organize posts into a calendar by category. It supports a shortcode so you can create a lot of calendars with different settings for different posts or pages on your blog. Every day in the calendar will list the posts published on that day for the selected categories.

Features

  • Simple and powerful. You don’t need a lot of settings to start using it. Just insert a shortcode into your post!
  • Highly customizable through CSS. Plugin provides example CSS which can be used for demo purposes and can be switched off in the plugin’s settings so you can define your own CSS for your calendars without being stuck to the excessive styles which the most plugins use, slowing down your website.
  • The starting day of the week depends on WordPress settings.
  • Monthly/Yearly navigation which can be shown through a shortcode option. You can choose to display only a specified month/year with or without a navigation bar or to show a current month/year only.
  • Include/Exclude author/category support.
  • Future posts support (Shows any future post by direct link, filter works using the is_single WordPress function. It doesn’t affects any other pages so if your website’s visitors don’t know a direct link to the future post it remains invisible to them as usual. I know it’s a little messy and I will limit it to the categories used in shortcode in future releases.)
  • WP_Rewrite support. (Pretty URL’s will look like http://example.com/my-post/cdate/2009-10 instead of http://example.com/index.php?p=1&cdate=2009-10. It’s depends on permalinks WordPress settings.)

Installation

WP-Cat2Calendar requires WordPress 2.6 or higher.

  • Download and extract the plugin onto your computer
  • Fill in the plugin extraction directory/folder to your blog’s plugins directory (usually wp-content/plugins)
  • Activate the plugin

Usage

Use WP-Cat2Calendar shortcode in your post/page to add a calendar.

You can add a calendar using the php lines:

$options = array(...);
echo wp_cat2calendar($options);

Options

  • cat_id – a comma separated list of category ID’s.
    1.0 – 1.0.1 – uncategorized by default.
    1.0.2 – all categories by default.
  • author_id – a comma separated list of author ID’s. (all authors by default)
    since: 1.0.2
    You also can use a special keyword post_author which will be replaced with a post author ID where shortcode is placed.
    WordPress bug (still in 2.8.5) at wp-includes/query.php line 1979 in exclusion so you can exclude only one author, but you can include multiple.
  • year – year you want to display in calendar (current year by default)
  • month – month you want to display in calendar (current month by default)
  • show_nav – show/hide month/year navigation, 0 or 1 (0 by default)
  • show_date – show/hide selected month/year title, 0 or 1 (0 by default). Have no affect if navigation is shown.
  • allow_change_date – allow user to navigate through a calendar even if navigation is hidden and user has direct link. Has no affect if navigation is shown.

Examples

[WP-Cat2Calendar cat_id="3,4" show_nav="1" year="2009" month="10"]

Show a calendar of posts for WordPress categories with ID 3 and 4 with navigation and the start date for a calendar will be October, 2009.

[WP-Cat2Calendar cat_id="1" show_nav="1"]

Show a calendar of posts for WordPress category ID 1 with navigation and the start date for a calendar will be current date.

[WP-Cat2Calendar author_id="1, 2, 3" cat_id="-4,-5"]

Show a calendar of posts posted by users with ID 1, 2, 3 for all WordPress categories excluding categories with ID 4 and 5.

[WP-Cat2Calendar author_id="-post_author"]

Show a calendar of posts posted by any user except a posts which belongs to the author of post where shortcode is placed.

[WP-Cat2Calendar author_id="post_author"]

Show a calendar of posts posted by the author of post where shortcode is placed.

Screenshots

Change log

1.0.4

  • URL Rewrite conflict with other plugins is solved
  • Design and behaviour were reworked. Now it shows posts list with excerpts when cursor is over.

1.0.3

  • Localizable navigation date format
  • Months localization through WordPress
  • Title attribute added to the post links
  • Current date fix (wrong timezone)
  • URL Rewrite fixes, now it correctly works and even outside WordPress loop
  • Default theme changes
  • Contextual help update
  • Plugin’s direct call protection

1.0.2

  • author_id option added
  • include/exclude author/category support
  • insignificant code improvements and IE8 fixes in default.css

1.0.1

WP 2.6 related fix for default css

1.0

Initial release


Download

Download latest

Available on the WordPress Plugin Directory.

36 Comments to “WP-Cat2Calendar”

  1. [...] Autor: KHK Hallo! Wenn Du neu hier bist, möchtest Du vielleicht unseren RSS Feed abonnieren.Das WP-Cat2Calendar Plugin von Andrew Mihaylov kann Postings zu einem Kalender organisieren. Über CSS ist der Output in [...]

  2. alex says:

    hello. have a question. is it possible to use this plugin not only for categories, but also for author page, if i have about 10 authors? so, it will be author own calendar with himself posts.
    thanks

  3. Andrew says:

    @alex, it’s impossible now but it’s a nice idea and I will make this improvement in a next release on a weekend.

  4. alex says:

    @Andrew, thanks for answer)) it would be great)

  5. alex says:

    Not release yet?)

  6. Andrew says:

    @alex, already out ;) let’s try

  7. alex says:

    я только сейчас увидел, что вы(ты) соотечественник)))

  8. alex says:

    кстати, по поводу функционала, я давно пытался найти календарь, где бы была возможность добавить данные с календаря на сайте в google calendar. везде обратная вещь.

    это как вариант развития плагина:
    Share it to:
    Outlook
    Google
    iCal
    Yahoo!

  9. Andrew says:

    Календарь вообщем-то вечный, т.е. он показывает любые записи за любой промежуток времени, а экспорт всех записей в виде календаря на больших сайтах вероятно будет очень долгим, хотя если как-то организовать это проще, то возможно идея хороша, я пока не разбирался с этим.

    p.s: я видел плагины календарей, которые позволяют выводить в iCal к примеру, был какой-то Event Calendar, но там суть та, что там нужно заполнять события, а тут они с рубрики цепляются.

  10. alex says:

    я не имел ввиду экспорт всех записей. а только какой либо.
    скажем любого анонса какого либо события, например, в будущем.

  11. Andrew says:

    Ага, понял. Вообще, решаемо, спасибо за идею :) Но вообще я пока бьюсь с проблемой того как спрятать посты в календаре, т.к. если у нас есть много постов в месяц, то заголовки просто заполонят всю таблицу. Я делал вывод поверх при наведении и по клику, но пока я не особо этим доволен, что-то не то :) Да и еще сейчас там по умолчанию в wp ограничение на вывод постов, по-моему 10, я исправлю это завтра, только сейчас в голову пришло :)

  12. alex says:

    мне кажется самая проблема если несколько записей в один день.

  13. alex says:

    я имел ввиду, что когда большие заголовки столбик будет вертикально увеличиваться очень сильно. не очень красиво. особенно если заголовки немалые.

  14. Camilo says:

    Hello! Great plugin!!
    I’m just having a couple of problems regarding localization:
    - You seen to be using the function “gmdate” a lot, but it returns strings in english for me (I’m installing it on a Brazilian Portuguese blog). Could you use something like date_i18n? It’s been around since WP 0.71 (and I had never noticed it!).
    - While at it, you’re using the date format “F, Y”. Could you make it localizable? It doesn’t sound that right in portuguese.
    I also have a little suggestion: the links to the “events” don’t have the ‘title’ attribute. Maybe the event (post) excerpt could be used?
    Thanks for your time! Regards from Brazil!

  15. Andrew says:

    @Camilo, Hello there! Thanks for feedback, I’ll add it to plugin’s “to do list”.

  16. Edgar says:

    Hello Andrew,
    Congratulations, great plug-in!

    I’m using your plug-in in a Spanish Website; it is possible to change the months in Spanish?
    Thanks for your time,

  17. Andrew says:

    Edgar, thx for congratulations, it will be in a next release I hope on this week.

  18. Joco1114 says:

    Please write me an example, how to use the $options variable while I would like to insert it into PHP. For example this line:
    [WP-Cat2Calendar cat_id="3,4" show_nav="1" year="2009" month="10"]

    Thank you!

  19. Andrew says:

    @Joco1114, all the same except parameter names used as array keys:

    $options = array(
     'cat_id' => '3, 4',
     'show_nav' => true,
     'year' => 2009,
     'month' => 10
    );
    
    echo wp_cat2calendar($options);
    
  20. Joco1114 says:

    Thank you! I thought it is more difficult… :)

Leave a comment


This entry was posted by and on Saturday, October 24th, 2009 at 15:16.

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.