check if post title is included in event title
-
hey barry,
first of all nice plugin, i use it with the free version of theeventscalendar.i use the event plugin only for the calendar, because of the lack of multiple events (even the pro version does not support manually entering many dates for one event). so i have to create a event for every new date which is not a big deal with the duplicate button (by the way: your duplicate button is not working good, all the extra fields and tags get not copied at all – i use Duplicate TEC Event Plugin which works quite better – maybe you check).
my goal is to load the event dates that belong to one event into the blog post of the event (where you can also do the booking).
the title of the post is the same as the title of every event entry (e.g. post title “wine workshop” and event title “wine workshop” “wine workshop” “wine workshop” is an post that includes 3 dates).
the post has an own template and also the booking is created there.
well, somehow i need the possibility to check via php if the event title is equal to the post title and put out dates with this condition.i tried a couple of things, but i simply cannot get it work.
since the post title of the event entries are the same their permalink slugs are different (e.g. “wine-workshop” “wine-workshop-1” “wine-workshop-2”)the only solution i found is a bit complicated:
1. i gave all event entries that belong together the same tag as the post title (here: “wine workshop”)
2. since the tag is converted without spaces i check if the tag is equal to the slug of the post (because the permalink is set to /%postname%)
3. i put out the dates of the events entries in a new linecode result:
<?php $slug = basename(get_permalink()); ?>
<?php echo do_shortcode('[event_embed tag="'.$slug.'"]</br>{start_date}[/event_embed]');?>
in the blog post “wine workshop” this puts out all the upcoming dates, when the workshop takes places.
but it would be much much cooler to check directly if the blog post title is the same like the calendar post title. is that possible?
regards
thomas
- The topic ‘check if post title is included in event title’ is closed to new replies.