Home › Forums › Calendar Products › Events Calendar PRO › Recurring Holidays without date on permalink? Without Multiple Entries?
- This topic has 2 replies, 2 voices, and was last updated 13 years, 6 months ago by
Jonah.
-
AuthorPosts
-
October 6, 2012 at 3:15 pm #26211
Andrea
ParticipantI have a calendar that lists many holidays (example like Christmas) which is a yearly holiday, but doesn’t need a separate url for each year’s Christmas listing. Is there a way to just make Christmas show up on Dec 25 no matter what year it is? It’s a recurring event, but not something that needs a “repeat for 20 years” type recurrence rule. Having 10 or 20 instances of Christmas listed in the event posts area seems a bit silly, too. For things like Thanksgiving which is last Thursday of November it is brilliant, but for basic recurring it seems a bit overboard. Would love an easy “yearly” button that ignores the year and just makes one entry.
I bought pro for recurring events only, but it’s actually making adding events more of a chore. The basic version is so clean and good looking it’s just what I wanted (I tried a ton of calendars before yours), pro was to make the yearly holidays not have to be added 20 times, but that’s sort of not working out. Any ideas or options?
Thanks for your help. I really appreciate it.
October 10, 2012 at 1:13 pm #26434Jonah
ParticipantHi Andrea,
We do have something like this on our map for a future feature but for now you’d have to figure something else out. The only thing I can think of would be using categories or using our tribe_create_event() to programatically create the events but you’d have to find some crafty PHP method to auto create the events on an on-going basis and they would still show in the admin. One way you could hide the events in the admin is if you created a “Holiday” category and then filtered the posts in the admin using pre_get_posts() like so:
function set_custom_post_types_admin_order($wp_query) {
if (is_admin()) {
// Get the post type from the query
$post_type = $wp_query->query['post_type'];
if ( $post_type == 'tribe_events') {
$wp_query->set( 'tax_query', array(
array(
'taxonomy' => TribeEvents::TAXONOMY,
'field' => 'slug',
'terms' => array('holidays'),
'operator' => 'NOT IN'
)
)
);
}
}
}
add_filter('pre_get_posts', 'set_custom_post_types_admin_order');
I hope that helps!– Jonah
October 10, 2012 at 1:19 pm #26435Jonah
ParticipantOne idea as a follow up for auto creating the events on an ongoing basis would be to create some date loops (http://www.if-not-true-then-false.com/2009/php-loop-through-dates-from-date-to-date-with-strtotime-function/) that would loop through each specific holiday and you could call the tribe_create_event() function on the given dates…
-
AuthorPosts
- The topic ‘Recurring Holidays without date on permalink? Without Multiple Entries?’ is closed to new replies.
