FyireChilde
Forum Replies Created
-
I have been living with the fact that my “schedule” page posts oldest events at the top. Since everything else worked awesome, I was living with it, but in the past week the newer posts were bumped off the main page and it stopped working for me.
I have hunted and gathered off the forum, and came up with a small fix for it with trial and error and felt a plain English addendum to my previous post was necessary for anyone who doesn’t understand a lot of code.If you wish for your list view calendar template page to display only upcoming events, open your template and find the code:
<?php query_posts('category_name=events'); ?>
Replace it entirely with this:
<?php query_posts('category_name=events&eventDisplay=upcoming'); ?>
This will give you a page that displays entries or events out of the calendar set in the future. However many posts per page you have set will display as usual, as far as I can tell, and you can still navigate to list/calendar and past events via a link your page should display if you followed all my previous steps, I did insert a
<br/>
in my template page before the</div>
tags, but that was purely cosmetic. Code Sourced from This
I have not messed with a past event display, since I figure wp’s basic archiving function covers that fairly well, and I know the important events are the ones that are still going to happen.
I assume that a display of past events can be made by replacing:
category_name=events&eventDisplay=upcoming
withcategory_name=events&eventDisplay=past
but I could be wrong. XD;
Hope it helps if anyone is having the same issue.@gizmo81 –
I did not have that problem in any of my experiments. So I’m not sure how much help I will be, but I can think of two places to look on a ‘Murphey’s Law’ basis. I also consider myself average in code, but possibly not as good as you are looking for:1. Have you updated your plug-in or word press version between coding the template and putting it up on the site for use? fix – remake your template with the latest version of code.
2. Have you been altering code in files other than your specifically created page template? fix – reset it all to default, and start again. Altering your main site header can make things look exactly how you want them too, but can really alter your site function across the board. I have stuck to only altering my separate page template file, and have had no unexpected errors in my site function aside from making the specific page work as desired. Is it possible you turned the actual file for one of your calendar views into a template by accident?
Just some starting places, I save original versions of all my files to make sure I can go back to defaults…I hope I helped you a bit, Good Luck!
thank yo for this! helped me in my own troubles! <3
<?php query_posts('category_name=events&eventDisplay=upcoming'); ?>
will also display correctly in newer versions if you do not know the category # for your event posts. =D@joggi, thank you for trying to help me. I think I understand what you are trying do there with your fix, but I am extremely reluctant to change files that are not specific to the calendar page alone. I don’t want to run the risk of it causing problems with other things in the future…
I never feel comfortable changing things I don’t fully understand or need to change to get the perfect result. I wonder if there is a way to do something similar to your fix in the calendar page template file itself?
Alright, I fixed the widget side nave problem myself! =B
The trick was to grab the code out of php file my version referenced instead of what you have there. …doy…It still doesn’t look exactly how I want it to…if anyone has any thoughts on how to make it shrink and center a bit? I’d be all ears.
@vayu & SebAston, dear god thank you for this so much! This was a gem of information!@idavila: I’m not a code guru either…when I’m changing wp code I back up my original files before I start in case I make a mistake, I suggest everyone do the same, ‘specially if you are following all my other advice. IF, like me, you are running the most current versions of both wp & event calendar this is how I did what I did~
Step One: Make a new Page Template
simple version:- with your ftp server download the page.php file from your wp sites selected theme. YOURSITE/wp-content/themes/YOURTHEMENAME/page.php
- change the name of this page to something like “calendar-page.php” on your computer, make sure it stays a php file if you use an editing program
- upload the file to YOURSITE/wp-content/themes/YOURTHEMENAME/ folder on your wp site via ftp
- in your online wp admin panel go to appearances menu, “editor” then find the file that has “calendar-page.php” as it’s file name
- Highlight all of the text in this file and paste:
<?php /* Template Name: Calendar */ ?>
You can also replace the code in your new template php in a code editor like dreamweaver or whatever before you upload it…if you do that you can skip to step 2 right after checking that it appears in your editor.
Either way, you should now have a template that can be selected when you make a new page, but it is completely blank to be filled in with your calendar code when you grab it! Save “calendar-page.php” in your online editor, if that is what you used, and continue~Step 2: Go to your plug in panel, find the event calendar in the list. See where it says “deactivate | edit”? Click edit. You will now be in a browser that looks like your regular theme editor, but it is specific to your calendar widget.
Decide if you want the list (like your main page but only event entries) or grid view (traditional calendar) of your calendar on your page.- List: click the-events-calendar/views/list.php
- Grid: click the-events-calendar/views/gridview.php
Open your chosen file in the editor, Select All, copy and then return to your main appearances editor and click on your “calendar-page.php” again.
Underneath the small bit of code it contains paste everything you just copied. Save.Step 3: Use the trick presented here in this thread to make it display~
Find the line in your file that reads:
<div id="tec-content" class="upcoming">
in list view
<div id="tec-content" class="grid">
in grid viewaltering none of this code, place your cursor at the end of that line and hit enter, then paste:
<?php query_posts('category_name=events'); ?>
Save.Step 4: Link this to your page.
Go to the page publishing section of your wp user panels. You can convert an old one or make a new page. While you are editing/creating your page there should be an area denoting “Page Attributes” with a drop menu for template…select Calendar. Make sure you have no text on your page and save.You should end up with something like What I Have!
I don’t know how to make it not take up all of the page, but frankly I don’t care, it will link to your regular event calendar functions just fine and I chose the list view since it looks better sprawled out, of course right now it’s lipstick on a pig for my new site, but functionality comes first.
I’m a little apprehensive about updates to this widget in the future making me have to reup my template, but I suppose it is a necessary evil to get what I want, I like how smart finally figuring this out made me feel, but…short code ftw please!thanks again SebAshton and Vayu, I cannot stress how helpful you were!
any word on how to fix this? I don’t mind if my side navigation widget area goes away, I just don’t want it continuing forever unto the horizon below it. =/