Posted: April 9, 2013 at 2:34 pm
|
Hello. I know that in the settings I can choose to display the description of an event when I use the EVENT LIST shortcode. However I have a category called archive where I want to display all of the past events, but I don’t want the description to appear on this page diplay, I just want to show the title (which would link to the full description). I was wondering if there was a shortcode parameter that could do this (description=false) or if there is a way to go about it? Thank you! |
|
Hi There isnt a shortcode that does this out of the box, but it is doable. My thoughts would be to look at using the Custom Files add on, particularly the ESPRESSO_TABLE shortcode. You would need to modify the espresso_table.php template to remove aspects of the table like the register column though. |
|
Thanks, Dean. I’ve been trying the ESPRESSO_TABLE shortcode. When I filter by category, it shows all of the events, not the ones set with my category “archive”. I also searched the forum and saw that the shortcode should use “category_identifier” and not “category_id” but neither of those worked for me. This is the shortcode I’m using: [ESPRESSO_TABLE category_identifier=”archive” max_days=”360″ qty=”100″ order_by=”start_date”] Is there a different way to filter the category? Thanks! |
Hi there, I checked this on my test site and it looks like the category_identifier needs to match the unique category identifier set in the category manager. The category name doesn’t seem to work. As an aside, ‘qty’ isn’t a valid parameter. You can use ‘limit’ instead to limit the number of events displayed. Also please note that you’ll need to ‘show_expired=true’ parameter to show the expired events. |
|
|
Hi Josh, My unique category identifier is also “archive” – unless I am missing something? I’m in Manage Event Categories >Edit Category archive and cat name is archive and so is the unique category identifier. I changed the un. cat. id to archive1 and updated the shortcode and it still didn’t work. I also did change qty to limit, thank you – and added the show_expired=true as well. Still nothing is coming up. Here is my new shortcode: [ESPRESSO_TABLE category_identifier=”archive1″ show_expired=”true” max_days=”360″ limit=”100″ order_by=”start_date”] and here is the page it is on: http://www.still-point-press.com/TRC/event-archives/ Thanks for your continued help! |
Hi there, Can you try turning on wp-debug by editing the wp-config.php file? There may be an error that will display to help narrow down the issue. Also, can you post the contents of the espresso_table.php file that you have set up into a pastebin? I’d like to compare it the version I’m using just to make sure we are dealing with the same code. |
|
|
This is what I got when I turned wp-debug on: Warning: mysql_connect() : Access denied for user ‘x’@’localhost’ (using password: x) in /moderated/wp-includes/wp-db.php on line 1141 Contents of espresso_table.php to follow… |
|
<?php global $load_espresso_scripts; if ($category_identifier != 'NULL'){ $show_expired = $show_expired == 'false' ? " AND e.start_date >= '".date ( 'Y-m-d' )."' " : ''; if ($type == 'category'){ echo espresso_get_table($sql); } $category_name = $wpdb->last_result[0]->category_name; <thead class="espresso-table-header-row"> <?php foreach ($events as $event){ $event_desc = wpautop($event->event_desc); $register_button = '<a id="a_register_link-'.$event->id.'" href="'.get_option('siteurl').'/?page_id='.$event_page_id.'®event_action=register&event_id='.$event->id.'&name_of_event='.stripslashes_deep($event->event_name).'">View Event Details</a>'; //Check to see how many open spots are available if ( $open_spots < 1 ) { $live_button = 'Closed'; } ?> <td class="td-group"> <?php |
The mysql connect error is a bit strange. I did test out the code you posted and it does work on my site. Do you get the mysql connect error if you try [ESPRESSO_TABLE] and do any events display when it’s just the [ESPRESSO_TABLE] shortcode (no added parameters?) |
|
Actually, it looks like the database password line might have been changed accidentally when the wp-config.php file was edited. You’ll need to re-enter the correct password that was there before to bring the site back up. |
|
|
I get the mysql error on any page it seems…. is that something I should run by my host? It’s a bit out of my expertise. |
|
Oops just saw your other reply. I will look into that right now. |
|
OK my wp-config file was strange, I don’t know how it was working before but the user names had dashes instead of underscores, and I think it was just working by chance until I did the debug thing. Then it stopped because the database fields were incorrect originally… ! Anyway, I now have the debug working and you can view all of the errors here |
|
In case it’s easier; here are the event espresso specific ones: Notice: Undefined offset: 0 in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 63 Notice: Trying to get property of non-object in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 63 Notice: Undefined offset: 0 in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 64 Notice: Trying to get property of non-object in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 64 Notice: Undefined offset: 0 in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 65 Notice: Trying to get property of non-object in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 65 |
Hi there, You’ll likely see those errors go away if you add another category into the system. You will not need to assign any events to the other category. Can you try that and see if that makes a difference? |
|
|
I added a new category and these errors were returned (and it did not return any content): Notice: Undefined offset: 0 in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 63 Notice: Trying to get property of non-object in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 63 Notice: Undefined offset: 0 in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 64 Notice: Trying to get property of non-object in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 64 Notice: Undefined offset: 0 in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 65 Notice: Trying to get property of non-object in /home/stillpoi/public_html/TRC/wp-content/uploads/espresso/templates/espresso_table.php on line 65 |
Hi there, I’m sorry that the espresso_table shortcode isn’t working as expected for you. I’m not sure why it’s not working in this case. It might be a better solution to add a conditional check to the event_list_display.php template where it pulls the description and make it not display the description for your archive page. Something like this will do the trick: //Show short descriptions if (!empty($event_desc) && isset($org_options['display_short_description_in_event_list']) && $org_options['display_short_description_in_event_list'] == 'Y'){ ?> <?php if (!is_page('event-archives')) { ?> <div class="event-desc"> <?php echo espresso_format_content($event_desc); ?> </div> <?php } } ?> The you can use the standard [EVENT_LIST] shortcode with a category parameter to display your list. You can copy the modified event_list_display.php template to your active theme’s folder and it will load from there and not get overwritten on an update. |
|
|
Thanks, Josh! I’ll try that. I appreciate all of your time and help. |
You’re welcome. Sorry the other shortcode didn’t work out. |
|
|
So…. using your code (thanks again!) the description does not show on the “archive” page – however I am using this shortcode [EVENT_LIST show_expired=true category_id=archives1] and it is showing -all- of the events, including current events, not just the ones that are expired / in the category “archives1” – any idea why that filter isn’t working? Thanks! |
Hi there, It looks like that’s not quite the correct way to specify a category. It should be either “category_identifier” or “event_category_id”. Please see this section of the shortcode documentation for more info: https://eventespresso.com/wiki/shortcodes-template-variables/#event-list |
|
|
I had tried [EVENT_LIST show_expired=true category_identifier=archives1] and I get no results, and when I had tried [EVENT_LIST show_expired=true category_identifier=archives1] I get all results, including current events that are not categorized as archives1. I just tried those two shortcodes again and got the same results. |
Hi there, It sounds like either the category isn’t getting saved in the database correctly, or the relation between the category and the event isn’t getting pulled. Is it possible for someone from support to get an export of the events tables from the database so we can investigate further? |
|
|
Yes I can try and get that to you. What’s the best way – do you want me to just paste it here once I export? |
That would be a lot to copy and paste here. You could either email the file to support@eventespresso.com or upload the file to something like Dropbox and send the link to the Dropbox URL. |
|
Thanks for sending. I imported the tables onto a local test site and created a page and put this shortcode on it: [EVENT_LIST event_category_id=archive1 show_expired=true] When I view the page, it’s displaying two events: So it looks like the category/events data is okay. Can you try the shortcode I used? |
|
|
Wow – this is so strange! I put that code that worked for you into my page and it’s still displaying everything: http://www.still-point-press.com/TRC/event-archives/ BUT when I use the sidebar widget to display only the archive/expired events it works… Just in case, I reverted to the original event-list-display.php page (In case I had done something wrong there) but even the default file returned all of the results, not the filtered results. Wish I had some other ideas…. |
Hi there, It might be good to see what happens if the copy of event_list.php that’s in /wp-content/uploads/espresso/templates is removed or renamed. The event_list.php template handles the category filtering for the event list. Aside from that, it might be a plugin or theme conflict that could be ruled out by temporarily switching to the default WordPress theme and temporarily deactivating other plugins. |
|
|
Hi Josh, When I removed event_list.php from the uploads/espresso/templates folder on the server the archive page actually worked….but without my display changes. So now the problem is that I made many display changes to event_list_display.php – and according to what is happening (and your documentation) the two files have to “go together” in order for the event_list_display.php template file of mine to be accessed and used on the site. Is there a solution for this new issue? Thanks! |
Yes there are two: 1) Copy over a fresh copy of event_list.php from the Event Espresso plugin to /wp-content/uploads/espresso/templates. -or- 2) Copy your modified event_list_display.php file to your active theme’s folder and it will load from there. Option #2 is what I’d recommend because you will not need to maintain the changes in the event_list.php template the next time you update. |
|
|
HURRAH! I used #2 – and it works perfectly. I can’t tell you how much I appreciate your help and sticking through this troubleshooting process. THANK YOU! Yay! |
The support post ‘Shortcode for EventList description display?’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.