Deleted Events Not Going Away
-
Hi and thanks again for helping out on the question. After deleting an event, its still showing as published but the url changes to http://website.com/event/auto-draft__trashed
I updated the plugin but its still doing it so it might need another update, please advise.
-
And sorry for adding another question, but is there an easy way to include revisions of events posts without modifying the plugin files?
Hi,
My plugin should only list events with status Published. And this is also how it seems to work over here. When I delete an event, it’s not listed in the frontend of my website anymore.
Do you perhaps have a plugin installed which is altering the event/post list somehow?
Guido
Yes, you are correct. I was trying to ensure that posts with future dates show up as published, that was causing the delete issue. Do you know how I should go about getting future posts to have status published so they can show up on front end? Thanks.
Still don’t fully understand what you mean and what’s the problem you’re having… Do you mean the post date, instead of the event date? My plugin only uses the event date to list events. And only events with status Published.
Guido
Yes, I mean post date. The structure that your plugin has only shows the date of an event at the bottom. The client wanted it on the very top and I couldnt modify the css to do that. So..I was able to add the function to show the published date of the post at the top and then told the client to make sure the published date was the same as the event date.
The issue arises that scheduled posts dont show up on front end. I added a function to make the future posts show as published, but that caused an issue with events not being able to be deleted. Thats why I was asking if you know how I can get future posts to show without screwing up other functionality : )
Aha, I understand now.
In that case you could better use (copy) the event-date related code of my plugin, listed in file vsel-templates (string 14 – 35). Now the proper start/end date will be displayed.
The variables are defined in file vsel-variables:
$page_start_date = get_post_meta( get_the_ID(), 'event-start-date', true ); $page_end_date = get_post_meta( get_the_ID(), 'event-date', true );
Guido
Ok, I see the variables in the function vsel_single_content, but Im not sure what I can do to modify it. Can you please explain, & thanks for your time on this.
Hi,
To be honest, the instructions in my previous reply are quite general. I do notice now it’s not that easy to do.. you should make multiple adjustments to my code. Right now I don’t have time to tell you step by step what to do. Maybe later this week.
Guido
Hi again,
This code in your theme file
single
will display the event date(s):// get setting for date format $date_format_custom = get_option('vsel-setting-38'); // set date format if ( !empty($date_format_custom) ) { $date_format = $date_format_custom; } else { $date_format = get_option('date_format'); } // variables $page_start_date = get_post_meta( get_the_ID(), 'event-start-date', true ); $page_end_date = get_post_meta( get_the_ID(), 'event-date', true ); $page_date_label = __( 'Date: %s', 'very-simple-event-list' ); $page_start_label = __( 'Start date: %s', 'very-simple-event-list' ); $page_end_label = __( 'End date: %s', 'very-simple-event-list' ); // display date if ( empty($page_start_date) || empty($page_end_date) || ($page_start_date > $page_end_date) ) { echo '<p class="your-class">' . esc_attr__( 'Error: please reset date', 'very-simple-event-list' ) . '</p>'; } elseif ($page_end_date > $page_start_date) { echo '<p your-class">'; echo sprintf(esc_attr($page_start_label), '<span>'.date_i18n( esc_attr($date_format), esc_attr($page_start_date) ).'</span>' ); echo '</p>'; echo '<p class="your-class">'; echo sprintf(esc_attr($page_end_label), '<span>'.date_i18n( esc_attr($date_format), esc_attr($page_end_date) ).'</span>' ); echo '</p>'; } elseif ($page_end_date == $page_start_date) { echo '<p class="your-class">'; echo sprintf(esc_attr($page_date_label), '<span>'.date_i18n( esc_attr($date_format), esc_attr($page_end_date) ).'</span>' ); echo '</p>'; }
You should add this inside the loop.
Guido
That was what I needed, thanks!!
Laast questions, I changed vsel-widget-list.php to make the listed events look different, whats the chance there will be an update to that file in the future?
Hi,
I’m not planning an update anytime soon. But I cannot guarantee this file will not be updated in the future.
Via the plugin settingspage and with custom CSS you can also change the layout of the event list to your needs… so in most cases you don’t have to change plugin file itself.
Guido
Ok, I did try and change the settings and modify with css, but its not possible to get what I wanted because the way its coded…the content info of the event is outside of the wrapper where the title is. I needed to have them both inside the same div. Here is a screenshot of what it ends up looking like: https://res.cloudinary.com/marvel451/image/upload/v1563477847/Screen_Shot_2019-07-18_at_8.00.01_AM_ppbb3j.png
Thanks anyways for all your help.
Hi,
I need a (temp) link to see wat’s going on.
And FYI, I will update plugin this weekend because of some changes regarding support for the ACF plugin.
Guido
- The topic ‘Deleted Events Not Going Away’ is closed to new replies.