Posted: March 15, 2016 at 2:51 pm
|
I want to use my theme’s page.php for displaying single events instead of the blog layout. The theme is Enfold. I’ve followed the instructions at the bottom of this page: https://eventespresso.com/wiki/ee4-custom-post-types/ 1) Copied enfold/page.php to enfold-child/single-espresso_events.php But the single event is still being displayed as a blog post. The plugin “What Template Am I Using?” is offering some clues:
I also tried copying enfold/template-builder.php to enfold-child/single-espresso_events.php but still had the same blog look. Any thoughts on how I can troubleshoot this? THANKS! |
It sounds like the template switch worked for you, and I’ve verified using my own copy of Enfold. There may be some code in the templates that you’ll need to modify in order to remove blog-like elements. Can you spot in the page.php template (and also the includes/loop-page.php) the elements that you don’t want to be displayed? |
|
|
When I visit my Espresso page at dev.chicagochurch.org/registration/ “What Template Am I Using?” says the post type is “espresso_events”. On my other Page type pages it says the post type is “page”. Is there a way to make the post type come up as “page”? Yes, the undesirable parts are a search bar on the right, date of the event creation, category of the event, name of event author, etc. Thanks! |
The instructions in the documentation are for changing a single Event post type template to use page.php, but it sounds like you want to change the event archive view. The archive URL is /registration/ with no event slug after it. You can change the template used for the event archive by |
|
|
Yes, yes, of course! You’re helping me understand this. So how do I get rid of the search bar (event archive and single event) and the date, category & author (event archive)? If this is beyond the scope of help you can provide, I completely understand. I certainly don’t expect you to code or teach me PHP! |
The Date, category, and author are coming from the /includes/loop-index.php template part. You can remove the code that displays the date, category, and author code from the template part or copy the loop-index.php template part to your child theme and call it loop-event.php. Then in the archive-espresso_events.php template where it says you can change it to be As far as the search bar goes, is that added by a widget? Can it be removed by removing the Search bar from the active Widget settings? |
|
The support post ‘Single Event using page.php (instead of post layout)’ 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.