Templates not working
WordPress Event Management, Calendars & Registration › Forums › General Question › Templates not working
This topic contains 9 replies, has 2 voices, and was last updated by Justine 11 years, 9 months ago.
-
AuthorPosts
-
March 1, 2013 at 10:45 am #3660
I have a problem insofar as when I enable templates in the general settings of the event organiser it means that none of the content fits with my theme – the text is too big and pushes the sidebar to the bottom of the screen and the fonts and colours are all wrong, however if I disable templates, whilst it all looks perfect and fits in nicely with the theme it no longer displays any dates for any of the events, it simply shows the date it was created. Furthermore it no longer shows the venue or the category.
I understand that I may have to edit the default template to make this work, but I have no understanding of coding so would not know where to start. I have looked at your guidance on http://wp-event-organiser.com/documentation/editing-the-templates/ but have to be honest that it makes no sense to me. Can you possible help please?JustineMarch 3, 2013 at 10:26 pm #3672Hi Justine,
Hopefully the single event page looks ok? (1.7 improved theme compatibility in that respect).
As for http://wp-event-organiser.com/documentation/editing-the-templates/ – your theme has different files (usually called templates) for displaying different content. For instance it should have a
single.php
for displaying single posts. It may have acategory.php
for displaying posts in some category, andpage.php
for displaying pages.Typically it will not have:
- single-event.php – The template for displaying an event
- archive-event.php The template for displaying listings of evens.
- taxonomy-event-venue.php The template for displaying listings of events at a particular venue
- taxonomy-event-category.php The template for displaying listings of events at a particular event category
But you can think of
single-event.php
being assingle.php
for events,archive-event.php
as aarchive.php
for events, and the rest as a bit likecategory.php
. So as a starting point you can use the templates that already exist in your theme as a template for the events (just copy them and give them the appropriate name).But obviously they won’t display any event details – to do that you’ll need to add in appropriate functions to display event details. For that you can look at how the plug-in provided templates do it, and just mimic it. Hopefully then it will look fully integrated into your theme.
I hope that helps. (I’m not sure what else I can say unless you have a specific question).
Stephen HarrisMarch 4, 2013 at 1:11 pm #3689The Single Event page looks fine – it is the page that displays the full list of events that I have a problem with. Which template do I need to change to make that look ok?
JustineMarch 4, 2013 at 1:21 pm #3690Cancel last – I have found it. I am almost there, only now I seem to have a listing in the correct format followed by another listing in the wrong format and by sidebar is still pushed to bottom. Please look at http://www.justyourtype.org/DriffCycTest/?post_type=event to see what I mean. Any ideas what I have done wrong here???
JustineMarch 4, 2013 at 1:24 pm #3691This is what my archive-event file now says; are you able to edit it for me so that it does what I need it to?:
<
div id=”content” class=”narrowcolumn”>
Archive for the ‘’ Category
Posts Tagged ‘’
Archive for
Archive for
Archive for
Author Archive
Blog Archives
<div >
<h3 id="post-“><a href="” rel=”bookmark” title=”Permanent Link to “><?php the_tags('Tags: ', ', ', '’); ?> Posted in |
<?php else :
if ( is_category() ) { // If this is a category archive
printf("Sorry, but there aren’t any posts in the %s category yet.”, single_cat_title(”,false));
} else if ( is_date() ) { // If this is a date archive
echo(“Sorry, but there aren’t any posts with this date.”);
} else if ( is_author() ) { // If this is a category archive
$userdata = get_userdatabylogin(get_query_var(‘author_name’));
printf(“Sorry, but there aren’t any posts by %s yet.”, $userdata->display_name);
} else {
echo(“No posts found.”);
}
get_search_form();
endif;
?>
<!-- Page header--> <!-- Navigate between pages--> <!-- In TwentyEleven theme this is done by twentyeleven_content_nav--> max_num_pages > 1 ) : ?> <?php next_posts_link( __( 'Later events →' , 'eventorganiser' ) ); ?> <?php previous_posts_link( __( ' ← Newer events', 'eventorganiser' ) ); ?> <!-- #nav-above --> <article id="post-" > <a href=""> 'float:left;margin-right:20px;')); //Display the title the_title() ;?> </a> <!-- Output the date of the occurrence--> <time itemprop="startDate" datetime=""> <!-- Display event meta list --> <!-- Event excerpt --> <!-- .event-entry-meta --> <!-- .entry-header --> <!-- #post- --> <!--The Loop ends--> <!-- Navigate between pages--> max_num_pages > 1 ) : ?> <?php next_posts_link( __( 'Later events ←' , 'eventorganiser' ) ); ?> <?php previous_posts_link( __( ' → Newer events', 'eventorganiser' ) ); ?> <!-- #nav-below --> <!-- If there are no events --> <!-- .entry-header --> <!-- .entry-content --> <!-- #post-0 --> <!-- #content -->
JustineMarch 4, 2013 at 1:25 pm #3692Actually that copied wrong – trying again:
<?php
get_header();
?><
div id=”content” class=”narrowcolumn”>
Archive for the ‘’ Category
Posts Tagged ‘’
Archive for
Archive for
Archive for
Author Archive
Blog Archives
<div >
<h3 id="post-“><a href="” rel=”bookmark” title=”Permanent Link to “><?php the_tags('Tags: ', ', ', '’); ?> Posted in |
<?php else :
if ( is_category() ) { // If this is a category archive
printf("Sorry, but there aren’t any posts in the %s category yet.”, single_cat_title(”,false));
} else if ( is_date() ) { // If this is a date archive
echo(“Sorry, but there aren’t any posts with this date.”);
} else if ( is_author() ) { // If this is a category archive
$userdata = get_userdatabylogin(get_query_var(‘author_name’));
printf(“Sorry, but there aren’t any posts by %s yet.”, $userdata->display_name);
} else {
echo(“No posts found.”);
}
get_search_form();
endif;
?>
<!-- Page header--> <!-- Navigate between pages--> <!-- In TwentyEleven theme this is done by twentyeleven_content_nav--> max_num_pages > 1 ) : ?> <?php next_posts_link( __( 'Later events →' , 'eventorganiser' ) ); ?> <?php previous_posts_link( __( ' ← Newer events', 'eventorganiser' ) ); ?> <!-- #nav-above --> <article id="post-" > <a href=""> 'float:left;margin-right:20px;')); //Display the title the_title() ;?> </a> <!-- Output the date of the occurrence--> <time itemprop="startDate" datetime=""> <!-- Display event meta list --> <!-- Event excerpt --> <!-- .event-entry-meta --> <!-- .entry-header --> <!-- #post- --> <!--The Loop ends--> <!-- Navigate between pages--> max_num_pages > 1 ) : ?> <?php next_posts_link( __( 'Later events ←' , 'eventorganiser' ) ); ?> <?php previous_posts_link( __( ' → Newer events', 'eventorganiser' ) ); ?> <!-- #nav-below --> <!-- If there are no events --> <!-- .entry-header --> <!-- .entry-content --> <!-- #post-0 --> <!-- #content -->
JustineMarch 6, 2013 at 10:49 am #3713Hi Justine
Maybe PasteBin / Gist would be better? By the looks of things you are displaying the events twice – once how your theme displays it and once with the plug-in default template.
Stephen HarrisMarch 6, 2013 at 4:14 pm #3717Sorry, what do you mean by PasteBin / Gist?
<?php
/**
* The template for displaying lists of events
*
* Queries to do with events will default to this template if a more appropriate template cannot be found
*
***************** NOTICE: *****************
* Do not make changes to this file. Any changes made to this file
* will be overwritten if the plug-in is updated.
*
* To overwrite this template with your own, make a copy of it (with the same name)
* in your theme directory.
*
* WordPress will automatically prioritise the template in your theme directory.
***************** NOTICE: *****************
*
* @package Event Organiser (plug-in)
* @since 1.0.0
*///Call the template header
get_header(); ?><!-- Page header--> <!-- Navigate between pages--> <!-- In TwentyEleven theme this is done by twentyeleven_content_nav--> max_num_pages > 1 ) : ?> <?php next_posts_link( __( 'Later events →' , 'eventorganiser' ) ); ?> <?php previous_posts_link( __( ' ← Newer events', 'eventorganiser' ) ); ?> <!-- #nav-above --> <article id="post-" > <a href=""> 'float:left;margin-right:20px;')); //Display the title the_title() ;?> </a> <!-- Output the date of the occurrence--> <time itemprop="startDate" datetime=""> <!-- Display event meta list --> <!-- Event excerpt --> <!-- .event-entry-meta --> <!-- .entry-header --> <!-- #post- --> <!--The Loop ends--> <!-- Navigate between pages--> max_num_pages > 1 ) : ?> <?php next_posts_link( __( 'Later events ←' , 'eventorganiser' ) ); ?> <?php previous_posts_link( __( ' → Newer events', 'eventorganiser' ) ); ?> <!-- #nav-below --> <!-- If there are no events --> <!-- .entry-header --> <!-- .entry-content --> <!-- #post-0 --> <!-- #content -->
JustineMarch 6, 2013 at 4:16 pm #3718It is definitely appearing twice, only the first time it looks right but with the dates and venues missing, the second time it has the right info but the wrong format. Unfortunately I do not have the coding knowledge to amend t so it works right and would really appreciate some help here.
JustineMarch 11, 2013 at 4:21 pm #3859I still am no further on with this. Are you able to help me at all?
Justine - single-event.php – The template for displaying an event
-
AuthorPosts