Atte Moisio
Forum Replies Created
-
Forum: Plugins
In reply to: [AM Events] Displaying single event detailsYou don’t need to register the am_event post type in functions.php. It is done by the plugin already ??
Have you tried resetting the permalinks after changing the slug? In admin panel, go to Settings > Permalinks and press ‘Save Changes’. It should work after that.
Forum: Plugins
In reply to: [AM Events] Displaying single event detailsHey,
You could create a custom post type template
So, when clicking the event permalink, WordPress will look for a template named single-am_event.php and if it is not found, it will use the default single.php template.
To display event specific information like the dates, venues, and event categories on the custom template, you can either use the template tags provided by the plugin (see Other Notes), or the functions provided by WordPress for getting data from custom fields like get_post_meta.
Hope that helped!
Forum: Plugins
In reply to: [AM Events] Show all Events on one PageHi,
You should check out the small tutorial in ‘Other notes’. (Though I actually just found a typo on the tutorial meta_query for upcoming events).
Anyway, this should work:
... $args = array( 'post_type' => 'am_event', 'orderby' => 'meta_value', 'meta_key' => 'am_startdate', 'order' => 'ASC', 'meta_query' => array( array( 'key' => 'am_enddate', 'value' => date(am_get_default_date_format(), time()), 'compare' => ">" // startdate > value ), ), ); $the_query = new WP_Query($args); if ($the_query->have_posts()) { while ($the_query->have_posts()) { $the_query->the_post(); ... } }
Forum: Plugins
In reply to: [AM Events] Trying to mix it to the loop…Hi,
Sure it is possible. Add the following to functions.php
add_filter( 'pre_get_posts', 'am_events_get_posts' ); function am_events_get_posts( $query ) { if ( is_home() && $query->is_main_query() ) $query->set( 'post_type', array( 'post', 'am_event' ) ); return $query; }
Explained here: https://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home-blog-page
You could also modify the post loop in index.php to achieve the same thing.
Forum: Plugins
In reply to: [AM Events] Date resets itself to 1970Yeah, dd/mm/yy will be assumed as mm/dd/yy. You could use dashes or dots (dd-mm-yy or dd.mm.yy) and it should work fine.
Forum: Plugins
In reply to: [AM Events] Date resets itself to 1970Hey,
There could be a problem with the date format. The plugin uses php strtotime to parse the date, which cannot handle localized input for example. Could you specify the input field format you’re using when editing the event dates?
The datetimepicker format is currently defined in the translation files, but I intend to move it to the plugin settings page in the future.
Forum: Plugins
In reply to: [AM Events] Translation in French done…Hi,
thank you for the translation! You can send it anyway you like. My e-mail is atte.moisio[at]attemoisio.fi
Forum: Plugins
In reply to: [AM Events] Events listing and Events DetailsCurrently there are no shortcodes for displaying the events in a page, as it is intended to be done using custom page templates. This allows full control of the event page layout.
In case you can’t or don’t want to modify your existing theme, I suggest creating a child theme. That way you it won’t affect your base theme.
I know pretty much all the other plugins offer shortcodes for a page, but also limit the layout to only a few different options. The idea for my plugin is to easily implement the events in your own template.
You should check out the tutorial in ‘Other Notes’ on the plugin page. There is info on how to construct a WP_query for fetching and displaying the events. I also have an example child theme available here.
Hope this helped!
Forum: Plugins
In reply to: [AM Events] flexibility in venue input and displaystopThank you for the feedback!
I may consider adding those features in the future.
Forum: Plugins
In reply to: [AM Events] Changing slugI’ve added an option for changing the slug in the plugin settings. Will be included in the next version ??
Forum: Plugins
In reply to: [AM Events] Easier examples of integrationHi,
Unfortunately the shortcode/templating system is only for the widget at the moment, as the events are otherwise intended to be showed using custom templates and wp_query.
However, you could try finding a plugin that allows inserting widgets into pages.
Forum: Plugins
In reply to: [AM Events] Widget: Not Removing Event That's PassedHey,
It currently shows events starting from exactly 24 hours before the current time.
As a quick fix you can remove the “
- (60 * 60 * 24)
” part from'value' => date('Y-m-d H:i:s', time() - (60 * 60 * 24)),
in widget-upcoming-events.php
I’ll look into adding an option to change the offset in the next version.
Forum: Plugins
In reply to: [AM Events] Show "No upcoming events" in widget when events are emptyAs a short term solution you could add
if (!($loop->have_posts())) { echo '<p>No upcoming events</p>'; }
in widget-upcoming-events.php right after
$loop = new WP_Query( $args );
Forum: Plugins
In reply to: [AM Events] Show "No upcoming events" in widget when events are emptyHi,
Unfortunately not possible at the moment, but I’ll look into implementing that in the next version. (Probably in a week or so).
Thanks for asking!
Forum: Plugins
In reply to: [AM Events] Adding an ExcerptHi,
Could you specify your problem? Is it the admin or the frontend you’re having problems with?
Displaying the excerpt is working just fine for me using either the_excerpt() or get_the_excerpt() in the template.
However, the excerpt is not currently supported for the widget, but I’ll probably add that in the next version.