Support

Home Forums Event Espresso Premium Custom Posts

Custom Posts

Posted: January 11, 2014 at 4:37 pm


Valerie

January 11, 2014 at 4:37 pm

I am trying to make my theme’s “latest posts” shortcode populate the latest events added on Event Espresso. For this, I have created a post category called “latest events” and when I add an event, I am creating a post and then selecting that category. However, I am not using the Espresso Event because my theme is not recognizing those posts so they don’t populate on the latest posts shortcode.

Everything seems to be working, but the post that it creates does not pull the featured image into the post. How can I make this work? and also, how do I edit the event information displayed on the post?

Wordpress version: 3.8
Event Espresso add-ons: MRE
New installation
http://mwptestsite.com/pintapaint/


Yukon Cornelius

January 12, 2014 at 4:03 pm

Hi Valerie,

i had the same problem, so i thought i’d share. If you navigate to an Event Post, and scroll below the content, you can see all the custom fields for your post. The one that called ‘event_thumbnail_url’ is pulling in your featured image, just as a custom field and not in the featured image spot as you’d expect.

So if you want to use the featured image in your theme where you’re using the event post custom post type, you need to use the following:

<img class="thumb" src="<?php echo get_post_meta( get_the_ID(), 'event_thumbnail_url', true ) ?>" alt="<?php the_title(); ?>" />

You can either use a conditional inside your index.php loop, or create a new template for the event post (espresso_event) custom post type, and pasting in your index.php and modifying that.

If you update an event, i’m not sure if the custom fields containing all the other info (date etc) get updated. Probably not. I’m guessing you would have to go in and change this manually.


Tony

  • Support Staff

January 14, 2014 at 1:16 am

Hi Yukon,

Thanks for sharing your solution 🙂

If you update an event, i’m not sure if the custom fields containing all the other info (date etc) get updated. Probably not. I’m guessing you would have to go in and change this manually.

Within an event if you scroll down to the bottom you should find the ‘Create a post’ feature. http://d.pr/i/Eg30

If already you have a post created for the event, changing the option ‘Add/Update post for this event?’ to Yes will update the event post with any new data you have added to the event (once the event is updated).

@Valarie

Did Yukon’s solution work for what you needed?

how do I edit the event information displayed on the post?

This depends on what you want to edit but generally you can either update the event using the method above, or find the event within your ‘posts’ and update it there.

The support post ‘Custom Posts’ 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.

Event Espresso