• Resolved Harshal24

    (@harshal24)


    Hi i have already formated my list of events & everything is up & running thanks to Marcus’ help.
    So here is what i want to achieve now 1 page which has all the events listed in a list format (5 events in one page),[done using event templates].
    & 2nd a category specific home page(3 events in one page) of that category, shown in a pinterest kind of boxes, which is where i am facing difficulty. I created a page template & pasted the new format

    <div id="primary" class="site-content">
    		<div id="content" role="main">
    
    			<?php $args = apply_filters('em_content_events_args', $args);
    
    if( get_option('dbem_css_evlist') ) echo '<div class="css-events-list">';
    
    $args['limit'] = 1;
    $args['pagination'] = 1;
    
    $args['format'] = '<li>
    
        <div class="img-holder">#_EVENTIMAGE</div>
        <div class="course-excerpt">
            <h1 itemprop="summary">#_EVENTLINK</h1>
        </div>
    	<div class="date-box">
    	 <time itemprop="startDate" datetime="#Y-#m-#d"></time>
            <span class="month">#M</span>
            <span class="date">#j</span>
            <span class="day">#D</span>
        </div>
    </li>';
    echo '<ul class="event-list">';
    echo EM_Events::output( $args );
    echo '</ul>';
    
    if( get_option('dbem_css_evlist') ) echo "</div>";?>
    
    		</div><!-- #content -->
    	</div><!-- #primary -->

    & it displays the boxes properly but it is not category specific i.e the shortcode [events_list category=”28″ limit=”1″ pagination=”1″] on the page with that page template doesn’t work, i see all the events from all the categories.

    I hope i made sense.
    How can i make it category specific?

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

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    sorry for the confusion, but this shortcode [events_list category=”28″ limit=”1″ pagination=”1″] should work if you paste it in your wp page or post?

    Thread Starter Harshal24

    (@harshal24)

    OK i am guessing i didnt make myself clear enough.
    I have made an event list template & its in my theme folder under plugins\events-manager\templates which display the layout fine even with the shortcode.
    However i wanted a different layout for event lists displayed on category specific home page so i made a page template & pasted the above code. When i applied the template to the page it showed me the list of events with the new layout but it showed me all the events.
    So i want to find a way in which i can make it course specific.
    Is there a way to specify category in $args array?
    eg: $args['categoryID'] = 28;

    I think that should work.

    Hiya,

    Using a page template will not allow you to modify the output of a shortcode used in a page.

    Instead, you will more likely need to either;
    a) filter the shortcode output using a conditional for that page or
    b) create your own shortcode that queries EM directly

    Cheers,
    Phil

    Thread Starter Harshal24

    (@harshal24)

    Hi Phil,
    Thanks, I thought i was doing something wrong.
    Can you point me in the right direction with regards to filter the shortcode output using a conditional for that page?

    HOw do i go about doing that?

    Yep, take a look at output() function of the EM_Events class in /events-manager/classes/em_events.php

    Cheers

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Create a different page templates for event list for different pages’ is closed to new replies.