• i know the way to control the output inside the loop with a plugin template inside my theme folder, but i want to create a whole custom page template for my single event category.

    For the single event output or the eventlist it is possible to do that, but why do i cannot define a page template for the category-output? The output will be only rendered by the default page.php.

    I would be very happy for any help! ??
    ~Christian

    https://www.ads-software.com/plugins/events-manager/

Viewing 6 replies - 16 through 21 (of 21 total)
  • Wish Web Geek

    (@roxannabrock)

    I am having a few issues implementing this. I may be confused with the slug.

    1. I have created a template in themes/my-theme/events-manager/templates/category-single.php

    2. I have added the code you recommended below.

    global $EM_Category;
    EM_Events::output( array('category' => $EM_Category->slug) )

    3. I added html to the template below:

    <?php
    
    global $EM_Category; 
    
    // For the Format HTML please use the following placeholders:
    // https://wp-events-plugin.com/documentation/placeholders/
    $fmt_header = '<div class="eventcontainer">';
    $fmt_content = '<div class="eventlist">
    					<header class="entry-header">
    		           		<h1 class="entry-title">#_CATEGORYNAME</h1>
    		       		</header>
    					<div class="entry-content">
    						<table cellpadding="0" cellspacing="0" class="events-table"  width="100%" align="center">
    							<thead>
    								<tr>
    									<th class="event-time" width="20%">Date</th>
    									<th class="event-description" width="40%">Tour</th>
    									<th class="event-price" width="20%">Price</th>
    									<th class="event-booking" width="20%">Book Now</th>
    								</tr>
    							</thead>
    							<tbody>
    								<tr>
    									<td class="event-time" width="20%">#_EVENTDATES</td>
    									<td class="event-description" width="40%">#_EVENTLINK</td>
    									<td class="event-price" width="20%">$#_ATT{Price}</td>
    									<td class="event-booking" width="20%"><a class="book" href="/trip-preparations/trip-forms/reservation-form/">Book Now </a></td>
    								</tr>
    							<tbody>
    						</table>
    					</div>
    			</div>';
    $fmt_footer = '</div>';
    
    $args = array('scope'=>'all', 'orderby'=>'date', 'category' => $EM_Category->slug, 'format_header'=>$fmt_header, 'format'=>$fmt_content, 'format_footer'=>$fmt_footer,);
    
    $args = apply_filters('em_content_categories_args', $args);
    
    /* @var $EM_Category EM_Category */
    EM_Events::output( array('category' => $EM_Category->slug) )
    
    ?>

    Nothing is coming thru on my single category page. I assume I’ve confused something about the “slug”, which fonconnzi said he had gone to settings and changed, but I’m not sure what this means.

    And/or I am supposed to put this code in the
    Events > Settings > Formats/Layouts > Events Format under “Single Category Page format” (where I currently have: #_EVENTDATES #_EVENTNAME #_EVENTTIMES #_EDITEVENTLINK).

    Can you clarify a little more please? Thank you for this post. I have been looking for this solution for several months.

    Plugin Support angelo_nwl

    (@angelo_nwl)

    step #2, the category search attribute should be the event category id and not the slug

    https://wp-events-plugin.com/documentation/event-search-attributes/

    Wish Web Geek

    (@roxannabrock)

    What if I want a single category list for each category? Then I will not want to use just one category id.

    I want a single list of 10 events with category name, price, link and a general link.

    see category list: https://fsguides.com/reserve-a-trip/categories/
    click on any to get single category list (this is using default)
    https://fsguides.com/trips/categories/grand-canyon/

    Thank you.

    Wish Web Geek

    (@roxannabrock)

    I am still confused about the “slug” (i.e. fonziconnzi called his “eventscategories”). Mine is called /trips/categories. Do I place that in this code for category-single.php?

    global $EM_Category;
    EM_Events::output( array('category' => $EM_Category->slug) )

    I have put a category id in for slug, I have used the actual ‘slug’ for a single category and I have tried to use the id, but I want this to apply to all the categories, so I’m not sure what “slug” to use.

    In events manager under Settings > Formatting > Events categories and then single category page, do I use add the “Single category page format” or do I do that in the category-single.php page, using the $fmt_header, $fmt_content and $fmt_footer tags? I have added html to these tags in the category-single.php page using the adding html and using the Event & Category placeholders.

    Is this portion of the code something I should change if I want to display a list of events for each category?
    EM_Events::output( array('category' => $EM_Category->slug) )

    I’m sorry. I am trying to apply the information in this post, but I feel like I’m missing something.

    Wish Web Geek

    (@roxannabrock)

    Christian,
    I also noted above that you said to “set the output-page in settings->pages->eventcategories and on this page you can define any custom page template”. I had already done this, but this was for the category list, not the single category. The theme/events-manager/templates/category-single.php template is not listed (since it’s not a page on my site).

    Was this just additional information on setting up the main Categories page?

    Thank you.

    Thread Starter Christian Rüggeberg

    (@arkonisus)

    @wish Web Geek

    EM_Events::output( array('category' => $EM_Category->slug) )
    If you are using the “postname”-option for your permalinks you can use the event category slug for searching.

    If your theme supports different page templates and you set the output-page in settings->pages->eventcategories
    then you can choose a different page template for your category output.

    Yes, the single category ist also a list because normally there are more than one event assigned zo it – or what do you mean?

Viewing 6 replies - 16 through 21 (of 21 total)
  • The topic ‘Custom page-template for single-category not possible’ is closed to new replies.