WordPress.org

Support

Support » Plugins and Hacks » Events Manager » [Plugin: Events Manager] Single Event Page

[Plugin: Events Manager] Single Event Page

  • Hi,
    my setting for the events page is [No Event Page] and am using template tags to display future and past events in on of the pages. The event list works fine… shows all the events (both future and past) but when i click the event it does not go to its single page rather is 404.

    So i tried with copying the single-event.php file to my theme but no luck and then i tried copying all the templates in my theme inside plugins folder as mentioned in your documentation but again no luck.

    Any help will be great..

    Thanks!

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

Viewing 15 replies - 1 through 15 (of 17 total)
  • no luck…

    let me explain my recent settings:

    I have a page for events called “Events” with custom WP template called “Events”
    – EM Settings:
    – Events Page -> Events
    – Show Events page in lists? -> No
    – Disable title rewriting? -> No

    And am using template tags in my event template “template-events.php” to show all the future events in one section and then all the past events in another section.

    The thing is that it is working but when i click on the listed event title to go to the detail page, nothing happens. I mean the URL changes to eg. http://abc.com/events/event/EVENT_TITLE but there is no detail rather shows the same list of Future and Past Events. Even i tried with define(‘EM_DISABLE_PERMALINKS’, true); but still the same case, the url changes to http://abc.com/events/?event_id=8

    Please need some light…

    Thanks!

    can you post your code on how you show future/past events.

    Plugin Author Marcus

    @netweblogic

    NetWebLogic Support

    do any single event pages work or is it just in your lists of past/Future events?

    Hi agelonwl,

    my code:

    <?php
    /* Template Name: Events */
    get_header(); the_post();
    ?>
    <!-- EOF Header -->
    
    	<div id="container">
    		<div class="page-content">
    
    			<div class="content-main events">
    				<h2>Events</h2>
    				<?php the_content(); ?>
    				<h3>Upcoming Events</h3>
    				<?php
    					if (class_exists('EM_Events')) {
    						echo EM_Events::output( array('limit'=>0,'scope'=>'future') );
    					}
    
    				?>
    				<h3>Past Events</h3>
    				<?php
    					if (class_exists('EM_Events')) {
    						echo EM_Events::output( array('limit'=>20,'scope'=>'past', 'pagination' => 1) );
    					}
    
    				?>
    
    			</div>
    			<?php get_sidebar(); ?>
    		</div>
    <?php get_footer(); ?>

    @marcus:

    Hi Marcus, Regarding the above code, I get a list of all events because of the_content() function and get the past and future events list too and the single page works but keeps the Past and Future events lists at the bottom which i don’t need on single page. Since i don’t need the default list of events showing up due to the_content() function, i comment that wordpress function and just use the EM codes for past and future events then the single page does not work. The URL changes to http://SITE_URL/events/event/EVENT_NAME/ but the page stays same (Past and Future Events List) with no event detail content.

    Hope this explains my issue…

    Any help is highly appreciated.

    Thanks!

    Plugin Author Marcus

    @netweblogic

    NetWebLogic Support

    you should keep the_content as all pages are served from there.

    however, you can choose whether to show the future/past events by wrapping it in an if statement with a template tag like ‘is_events_page()’

    Hi Marcus,

    do you mind providing an example snippet as reference to my code??

    Thanks!

    Hi,

    tried a lot of things but no luck…

    Any thoughts/suggestions on to achieve this will be a great help for me.

    The output hoping to get:

    Upcoming Events

      Upcoming Event Item 1
      Upcoming Event Item 2
      Upcoming Event Item 3

    Past Events

      Past Event Item 1
      Past Event Item 2
      Past Event Item 3

    Any new approach to achieve this along with working links when clicked on event title to view detail event??

    Thanks!

    Plugin Author Marcus

    @netweblogic

    NetWebLogic Support

    i suggest you read the docs and tutorials on our site

    http://wp-events-plugin.com/documentation/
    http://wp-events-plugin.com/tutorials/

    there’s many ways to do this

    Hey Marcus

    I am attempting to use the is_events_page() page to remove the events on the event single page however this function is throwing an error. Is it still supported? This is the method i am trying to use it in:

    if(is_events_page()){
    echo(‘true’);
    }else{
    echo(‘false’);
    }

    With debug turned on I am getting an undefined function error.

    Plugin Author Marcus

    @netweblogic

    NetWebLogic Support

    should be em_is_events_page()

    Thanks that is working for me. One last question. Is it possible to use:

    EM_Events::get(array());

    or something similar to create a custom single event page by passing it an argument that allows it only pull the single event?

    Right now my code looks something like this:

    if(em_is_events_page()){

    if (class_exists(‘EM_Events’)) {
    $events = EM_Events::get(array(‘scope’ => ‘future’, ‘town’=>$location, ‘category’=>$category ));

    foreach($events as $event) {
    if(date(‘n’, $event->start) != $month) continue;
    parse_event($event, ‘events’, $i);

    }
    }
    }else{
    the_content();
    }

    and I am just placing the code in the event single section of the plugin settings.

    Plugin Author Marcus

    @netweblogic

    NetWebLogic Support

    instead of EM_Events, use either

    $EM_Event = new EM_Event(id);

    or use

    $EM_Event = em_get_event(id);

    instead of grabbing many events and looping through them.

    Thanks again Marcus this has been very helpful. I have one last question and then I should be all set. I am attempting to use the:

    $EM_Event = new EM_Event(id);

    function which requires an event ID to generate a custom event single page. Is there some type of get event id function that I can use to get the id when I am on the single page. At this point my url is.

    siteurl.com/events/event/event-name

    Thanks again!

    Plugin Author Marcus

    @netweblogic

    NetWebLogic Support

    Hi, there’s two IDs, an event id, and a post id.

    You can use either one in shortcode.

    To find the post id, try editing an event, and look at the URL.

    If you’d like to view the event id, you can try using #_EVENTID in your event lists (sorry, need a better way to show that, will add soon). Another way is to view the bookings page, or edit the event front-end, and view the event_id=x in the url.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘[Plugin: Events Manager] Single Event Page’ is closed to new replies.
Skip to toolbar