Posted: November 4, 2013 at 10:18 pm
|
WordPress 3.7.1. Have WP site cloned and it is on a mamp local environment to make some thematic changes, work with templates, etc. Question Working with espresso_table.php template. All of the events when in the table indicate “registration is closed” when you click on the register and go the the event page. the relevant code in the template is below – it says it was written by Author: Seth Shoultes /* Before php on question is general HTMl markup, CSS, and template tags for the other table cells in this area – this is my notes (Matt) to help describe the code */ // html and template tags before php in question <?php foreach ($events as $event){ $event_desc = wpautop($event->event_desc); $register_button = '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).'">Register'; //Check to see how many open spots are available if ( $open_spots < 1 ) { $live_button = 'Closed'; } // more html and template tags before php in question <?php <?php Questions- 2) Can anyone tell me the point of the else statement – open_spots == 0. Is it just a reinforcement of making sure it will show closed. Doesn’t the first part of the If statement handle that -if( $is_active[‘status’] == ‘REGISTRATION_CLOSED’ ) 3. Why on both of those statements does the code not have a closing td tag. Neither <td valign="middle" align="center">; have a closing </td>. When you do put the closing tags in – the information disappears – so I am assuming it is good code. But not sure why it is so. Is it somehow using the td-group’s closing tag from the register_button statement? <td class="td-group"> 4. If I want to move the Register button to the first td in the row – I need to bring all of that code with it I take it. 5. Is that last line correct? Where is the closing php tag? <?php Thanks in advance. Matt |
|
code keeps getting messed up using code tag in editor not sure what the issue is. // html and template tags before php in question <?php foreach ($events as $event){ $event_desc = wpautop($event->event_desc); $register_button = '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).'">Register'; //Check to see how many open spots are available if ( $open_spots < 1 ) { $live_button = 'Closed'; } // more html and template tags before php in question <?php <?php |
|
Hi Matt, Sorry about the code formatting, it goes wonky sometimes. For large chunks of code we recommend using a service such as pastebin.com. Before I answer, please note that the espresso table will be deprecated in the near future, we have an alternative templating system we are about to launch which will replace it. 1) When you cloned the site, did you use something like WP Migrate DB in order to make sure that any URLS in the database were correctly changed? 2) Which file is this from? That code isn’t in the latest version of the Custom Files addon that I can see. 3) All the td tags in the default file (espresso-table.php) have closing tags, so not sure why yours don’t. 4) Yes 5) Yes it is correct. A closing php tag is not always required and in WordPress files it is advised to omit it – http://hardcorewp.com/2013/always-omit-closing-php-tags-in-wordpress-plugins/ |
|
Thanks for the answer. 1. I dont’s remember using “WP Migrate DB “. I used this documentation 2. The file’s name is espresso_table.php. I did not implement it – that is not a default template I take it. In my case I dont’t want a table anyway – I want to use divs to make it look like 2 column table with: 1 column program name and register button and second column with all the information data about the program ie. Start time; start date; end date, etc. – So I was using that since it is recognized by event espresso – just changing the markup. 3. Weird – okay. 4. Okay I will check that doc. Thanks. Question – this custom file addons when i go to the page to check it out
The account is a business license account – not sure why i get that message. I wanted to check out the files and read documentation on best practices-as someone else originally did the set up. Is there a link you can give me? Or direct me in the right place. Last quesion Thanks |
|
I wanted to just add this – what it comes down to – rather then play around with this code- what file or files are a good default file to work with to customize. Goal’s 1. I want to have a section pages that lists all of the events of the relative category. IE. Basketball events; soccer events; 2. THe lead into a detailed registration page 3. When the event is closed – it changes the markup in both to display a closed message Questions: Thanks |
|
correction on step # 3 – I would not choose a wordpress template as the espresso template is called from the shortcode I am using in this case event list. Can anybody confirm I am understanding that correctly? |
Hi Matt, Your best choice right now is to use the event_list_display.php and event_list.php templates and customize those if need be. When you migrate a site, the URL paths in the database (which can be links to events, image paths, and settings) need to be updated. The WP migrate DB plugin is an excellent choice. With your questions here: https://eventespresso.com/topic/local-development-environment-question/#post-65089 As of Event Espresso 3.1.x you are correct that they are not page templates, but rather shortcode templates. You can add your custom templates to /wp-content/uploads/espresso/templates and they will load from there. There is more info in the documentation about modifying templates. Here are a few links: https://eventespresso.com/wiki/put-custom-templates/ https://eventespresso.com/wiki/customizing-your-upcoming-events-widget-using-css-and-template-files/ |
|
|
okay thanks for the answers |
You’re welcome. I missed the question you had about the custom files add-on. You can download those files from your account page. |
|
The support post ‘Question code in template and about how espresso reacts to local dev environment’ 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.