WordPress.org

Ready to get started?Download WordPress

Forums

All-in-One Event Calendar
[resolved] Does my WP Theme support Custom Post Types? (1 post)

  1. Richard
    Member
    Posted 2 years ago #

    Does my Theme support Custom Post Types?

    When choosing a theme for your WordPress blog, be sure to check that the theme supports custom post types. If the theme does not, then you may have problems later with plugins which introduce custom post types.

    Since WordPress 3.0, it has been possible to create custom post types: http://codex.wordpress.org/Post_Types

    Many plugins make use of custom post types, including the All-in-One Event Calendar ("ai1ec"), which creates the “ai1ec_event” post type. As well, some custom post types may not make use of default WordPress taxonomies, which can be a problem with themes that presume all posts make use of Categories, for example. In the case of the All-in-One Event Calendar, the “ai1ec_event” post type uses its own custom taxonomies (Event Categories and Event Tags) and does not make use of either of WordPress's default Categories and Tags taxonomies.

    Therefore, theme authors are encouraged to ensure their theme supports custom post types and not presume that custom post types use the default WordPress taxonomies.

    Tip: One way to tell if your theme doesn't support custom post types is by viewing an event on its own page. If it lacks important styling that regular posts on your blog receive, then your theme probably doesn't support custom post types. A theme that supports custom post types should style events similarly to regular posts.


    I am using a theme which does not support Custom Post Types. What can I do?

    You have three options:

    1. Switch to a theme that supports custom post types. The majority of available themes have basic support for custom post types.

    2. Ask the theme author to modify their theme to support custom post types. Explain how their theme is having a problem with custom post types and try to provide the author with as much detail as possible.

    3. If the specific problem is simply that event posts are not being styled like regular WordPress posts, you can attempt to edit the theme's stylesheet yourself so that the theme can support the All-in-One Event Calendar custom post type:

    1. Edit the theme's "style.css" file ([WP root]/wp-content/themes/[theme name]/style.css). You may be able to do this within WordPress's built-in theme editor, or if not, via FTP.

    2. Search for all CSS rules that contain ".post" in them. For example, these could look something like this:

    .post {
    padding: 0.5em;
    background: #ddd;
    }
    .post p {
    margin: 1em 0;
    }
    .post .author, .post .date {
    color: #888;
    }

    3. Modify the CSS selector portion of these rules (everything preceding the opening brace "{"), by appending a comma "," then a copy of the entire selector expression in which ".post" is replaced with ".ai1ec_event". E.g.:

    .post,
    .ai1ec_event {
    padding: 0.5em;
    background: #ddd;
    }
    .post p,
    .ai1ec_event p {
    margin: 1em 0;
    }
    .post .author, .post .date,
    .ai1ec_event .author, .ai1ec_event .date {
    color: #888;
    }

    Article provided by Time.ly, authors of the All-in-One Event Calendar (available from time.ly).

    http://wordpress.org/extend/plugins/all-in-one-event-calendar/

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic