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/calendar-2009-10 instead of http://example.com/index.php?p=1&calendar=2009-10. It’s depends on permalinks WordPress setting.)

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(...);
global $wpCat2Calendar;
echo $wpCat2Calendar->display($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

Upcoming 1.0.9

  • Plugin context help update
  • ‘No future post’ support

1.0.8

  • Navigation URL hot fix for perma-structs without trailing slash

1.0.7

  • The most URL Rewrite issues fixed
  • ‘No Future Posts’ support removed till next release

1.0.6

  • Date format setting (date_format shortcode parameter)
  • Show prev/next month/year feature
  • New widget options: category select, author select, cell height
  • “Growing” URL bug fix
  • Minor CSS fixes

1.0.5

  • Widgets support
  • URL Rewrite issues, but some issues are still unfixed
  • Major JS fixes
  • cell_height shortcode parameter
  • Clickable dates following to category archive
  • Timezone fix
  • Minor visual changes
  • Minor bug fixes

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.

71 Comments to “WP-Cat2Calendar”

  1. and says:

    @Chiara, if you have 404 errors then try to deactivate and activate plugin again, I’m not sure why it happens but I’ll investigate later in free time.

    It’s not possible to restrict daily archive from showing other posts because it is built-in WordPress feature and by the way, there no way to determine the category to show using just a date.

    The best I can do is to add an option to disable daily archive links for calendar.

  2. Xavier says:

    Hello. Thanks for working on this great plugin.

    We’d like to include it into our upcoming blog, but first I’d like to make a simple modification if it’s possible.

    I’m trying to add the rel=”shadowbox” property into the links of the calendar.
    This is for the Shadowbox Js plugin which makes links display into lightbox popups. I just don’t know how to add that line into your plugin.

    This is an example of how it should go:

    Link

    Thank you very much.

  3. Xavier says:

    Sorry, the example was wrongly displayed before:

    a href=”http://localhost/wordpress/?p=101″ rel=”shadowbox;height=640;width=320″>My Image

  4. FDKelly says:

    Hello,
    The plugin works perfectly on my site. I am currently modifying the .css and encountered a slight issue. I changed the font to courier-new and adjusted the navigation’s .left and .right width% to better align the current month, but this makes the month titles looked crowded. If I make the text smaller, it’ll be too small to be comfortably read by everyone. After testing in firebug, I found I could fix the spacing issue if I simply removed the arrows before and after the ‘previous’ and ‘next’ months.

    The problem is that I have no idea how to remove those arrows.

    The calendar is in the tabbed widget on the top-right of my blog’s layout.

    Any help is appreciated, thank you.

  5. roger says:

    Hello and thanks for this brilliant plugin… I am trying to make it work with custom post type ids by replacing get_categories with get_terms but of course, I couldn’t get it done I am a noob… any suggestions?

  6. Karl says:

    Is there any way to change the date popup so that it extends down from the selected date box instead of extending upward?

  7. Julian says:

    Hey!

    Please help me!
    I just can’t add the calendar with options in my templates index.php.

    When I put the following code:
    $options = array(“cat_id=’4′”);
    global $wpCat2Calendar;
    echo $wpCat2Calendar->display($options);

    It displays the calendar, but the articles from all calendars.

    I couldn’t find good sample code on this.
    This article shows me that I can do this, but there is no example on adding the options to the array!

    Hope you can help me!
    Greets
    J.

  8. elvis says:

    Hi, is there any way to make this plugin work with custom post types?
    i have a site with custom post types and i want the calendar to only show a certain custom post type.
    If you could just point me to where it selects posts in the code, i can edit myself.
    thanks

  9. and says:

    @Julian, use key=>value style $options = array('cat_id' => 4);

    @elvis, the only way to fetch custom post types is to modify plugin and add post_type=custom_post_type to the query used in plugin, line 773 in wp-cat2calendar.php.

  10. Julian says:

    and!
    THANKS a lot, I was stupid…

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.