WordPress.org

Forums

Events Manager
[resolved] Single Event Page Issue (14 posts)

  1. Balders
    Member
    Posted 2 years ago #

    Hi there,

    on the normal single event page - below the title - we have the usual wp "posted by ... in ... at" box.

    In events manager the displayed date is not the posted date but the actual event date and the category for "posted in" is empty. The month is actually in english rather than German like my normal posts (March and not März).

    Please see here: http://www.der-backnanger.de/events/7-belinda-party-in-oberrot/

    I hope I made myself clear enough: Normal wp posts are fine, only event posts have this issue.

    Any thoughts?

    Cheers

    http://wordpress.org/extend/plugins/events-manager/

  2. agelonwl
    Member
    Posted 2 years ago #

    Hi,

    I get this too using default twentytwelve theme however it's more likely a theme issue rather than EM; maybe something to do with custom post types (since EM uses CPT) and a template file missing a translation?

    also, maybe you can try this link (creating single-event.php within your theme) - http://wordpress.org/support/topic/events-manager-eventslocation-pages-cant-get-sidebar?replies=21 or copy your theme single.php then rename it to single-event.php and add this snippet

    <?php echo date_i18n(get_option('date_format') ,strtotime(get_the_date()));?>
  3. Balders
    Member
    Posted 2 years ago #

    Hi there,

    thanks. Before I try your suggestions what does this snippet
    <?php echo date_i18n(get_option('date_format') ,strtotime(get_the_date()));?>

    actually do?

    Cheers

  4. agelonwl
    Member
    Posted 2 years ago #

    date_i18n - http://codex.wordpress.org/Function_Reference/date_i18n

    when I tried function get_the_date() it actually get the date but it's not translated and this function date_i18n did it correctly.

  5. Balders
    Member
    Posted 2 years ago #

    Thanks,

    much more important though is the empty category (posted in ...)

    Wouldn't it be easier to get rid of the whole bar like in

    if ( ! is_event() )

    I mean show it for wp posts and get rid of it for events.

    Do you have any ideas how to do that?

    Cheers

  6. agelonwl
    Member
    Posted 2 years ago #

    this might be a theme issue also since it's working fine using default theme twenty twelve.

  7. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 2 years ago #

    things to try:

    • Go to Settings >Pages > Event Pages > show as page
    • Copy e.g. page.php in your theme and rename to single-event.php
    • Your method would work fine, you may want to do the same for locations (suggestions above apply as well, just use 'location' instead of 'event'). Another option is check $post->post_type
  8. Balders
    Member
    Posted 2 years ago #

    Hi again,

    I found the part which is responsible for this section:

    <?php _e('Veröffentlicht am','swagger'); ?>
    						<?php echo get_the_date(); ?>
                            <?php _e('von','swagger'); ?>
                            <?php the_author_link(); ?>
                            <?php _e('in','swagger'); ?>
                            <?php // get parent category
    						if(get_post_type() == 'post') {
    							$category = get_the_category();
    							$cat_tree = get_category_parents($category[0]->term_id, FALSE, ':', TRUE);
    							$top_cat = split(':',$cat_tree);
    							$parentObj = get_category_by_slug($top_cat[0]);
    							$parent = $parentObj->name;
    							$cat_link = get_category_link($parentObj->term_id);
    						} else {
    							$parent = "";
    							$cat_link="";
    						}
    						?>
    
                            <?php if(!$parent=="") { ?>
    							<a href="<?php echo $cat_link; ?>"><?php echo $parent; ?></a>
    						<?php } ?>

    I tried with is_event but no luck. Do I have to write a funcion first? Sorry but I am no php man. Above code needs to go when I display an event.

    Any help would be appreciated. Cheers

  9. agelonwl
    Member
    Posted 2 years ago #

    Hi,

    try to add to change

    if(get_post_type() == 'post') {

    to

    if(get_post_type() == 'post' || get_post_type() == 'event' || get_post_type() == 'event-recurring' || get_post_type() == 'location') {

    or this link might give you an idea - http://pastebin.com/uLEak8Q5

  10. Balders
    Member
    Posted 2 years ago #

    Hi agelonwl,

    Thanks for helping.

    Your snippet doesn't work though:

    Catchable fatal error: Object of class WP_Error could not be converted to string

    Cheers

  11. agelonwl
    Member
    Posted 2 years ago #

    you can try this snippet

    if(get_post_type() == 'event' || get_post_type() == 'event-recurring') {
     global $post;
     $EM_Event = em_get_event($post->ID, 'post_id');
     $cat_name = $EM_Event->output('#_CATEGORYNAME');
     $cat_link = '<a href="' . get_term_link( $cat_name, EM_TAXONOMY_CATEGORY ) . '">' . $cat_name . '</a>';
     echo $cat_link;
    }

    btw, I tried this using template single-event.php - e.g. copy your theme single.php and rename it to single-event.php

  12. Balders
    Member
    Posted 2 years ago #

    Hi again,

    my page is called single-normal.php and sits in folder "inc".

    Do I have to rename to single-normal-event.php? Or still to single-event.php?

    Cheers

  13. agelonwl
    Member
    Posted 2 years ago #

    yes, you can try that however try to make another copy of your single-normal.php and then rename it to single-event.php; or another way is to ask your theme provider about supporting custom post type since EM is using CPT.

  14. Balders
    Member
    Posted 2 years ago #

    Hi there,

    it works now in the way that it grabs the right category and the date is in German. The displayed date itself though is still the actual event date and not the post creation date as in normal wp posts.

    Cheers

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic