Community Forums › Forums › Archived Forums › General Discussion › How do I rename/create a "Page" template?
Tagged: Events Manager, executive pro, page template
- This topic has 10 replies, 3 voices, and was last updated 10 years, 5 months ago by aself.
-
AuthorPosts
-
August 12, 2014 at 3:54 pm #118463aselfMember
I'm using the Executive Pro theme and the Events Manager plugin. I need to create a page template called single-event.php but I'm pretty sure I didn't create it correctly. I copied the page.php file from the Genesis framework (there isn't one in the child theme) and named it single-event.php and put it in my child theme folder.
Ultimately, I'm trying to get my events to use "Pages" instead of "Posts" for the template.
Here are the plugin instructions:
"If you choose 'Pages' then events will be shown using your theme default page template, alternatively choose from page templates that come with your specific theme. Be aware that some themes will not work with this option, if so (or you want to make your own changes), you can create a file named single-event.php as shown on the wordpress codex, and leave this set to Posts."
I did try asking in the Plugin forum first, but I'm not sure they understand the Genesis structure and thought I'd try here.
Thank you!
http://cdavidmcvayschool.com/re-mcvay/events/fair-housing/August 12, 2014 at 5:25 pm #118471SummerMemberTemplates for pages and posts is a basic WordPress function, not a solely Genesis one at all.
The template single-event.php will only work for single posts for a custom post type called Events, not for static pages.
Are you going to create new pages for each new event? In that case, you could rename that template page-events.php, then each time you create a new page/event, you'd select that template.
For more info on templates, read here: Codex: Template Hierarchy
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkAugust 12, 2014 at 5:33 pm #118472SummerMemberOr maybe it will? I just tested something on a site with static pages, and my single cpt templates do show up as templates I can select in my static pages.... I coulda sworn that was something I couldn't do back in WP 3.5 when I really needed to...
In any case, pages won't use that template by default, like the archives or other templates.
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkAugust 12, 2014 at 6:47 pm #118476aselfMemberThank you for replying Summer! The events are stored in the database so a page or post isn't created with each event. I was trying to follow the plugin's instructions above (in quotes), but wasn't confident that I had created the single-event.php file correctly. I think now that the problem is that the plugin settings aren't working correctly. I'm checking there too!
I still wonder though, did I create the single-event.php file correctly? I copied the page.php file from the Genesis framework (there isn’t one in the child theme) and named it single-event.php and put it in my child theme folder.
Thanks again!
August 12, 2014 at 7:54 pm #118483DTHkellyMemberAugust 12, 2014 at 7:59 pm #118484SummerMemberIt's a start, but I'm not sure how helpful of one it would be in this case.
The framework page.php and single.php only contain a call to the genesis(); engine, so no customization is happening at all. This makes them very good to copy and build on, but if you don't know php, or are hoping to modify some existing php to get the customizations you want, it's a taller ladder to climb.
That said, you know exactly where to paste your code snippets!
WordPress / Genesis Site Design & Troubleshooting: A Touch of Summer | @SummerWebDesign
Slice of SciFi | Writers, After DarkAugust 13, 2014 at 10:21 am #118595aselfMemberThank you both for replying. I think I'm getting closer.
I don't actually need to make any customizations. I only want my event plugin to use a "page" template instead of a "post" template because I don't want the meta data on each event page. It sounds like the plugin advises duplicating the "page" template and renaming it "single-event.php" so the plugin will recognize it. If I copied the page.php file from the Genesis framework (there isn’t one in the child theme) and named it single-event.php and put it in my child theme folder, should that meet the following requirements?
If you choose ‘Pages’ then events will be shown using your theme default page template, alternatively choose from page templates that come with your specific theme. Be aware that some themes will not work with this option, if so (or you want to make your own changes), you can create a file named single-event.php as shown on the wordpress codex, and leave this set to Posts.
My confusion comes in because page.php only has the Genesis () loop in it and I'm not exactly sure what that includes.
Thanks again!!
August 13, 2014 at 10:37 am #118601August 14, 2014 at 12:25 pm #118834aselfMemberThank you! I did some testing and the plugin is indeed using the correct file (single-event.php). The tutorials have been helpful but I must be missing something that is probably very obvious. How do remove the meta data that single-event.php is outputting?
Is the "Default Template" that my pages use, page.php from the Genesis folder? If so, where does it remove the meta data? I'll keep researching and learning :).
August 14, 2014 at 6:47 pm #118873DTHkellyMemberDid you take a look at this? http://www.studiopress.community/topic/how-do-i-renamecreate-a-page-template/#post-118601
(genesis);
includes a lot. That's why most genesis tutorials have remove actions/add actions.You need a tutorial that conditionally removes (remove_action) custom post type meta data.
Remove Post Info and Post Meta from Custom Post Types in Genesis Theme in WordPress
August 15, 2014 at 4:43 pm #119130aselfMemberWow. I finally accomplished my goal. Thank you for your help!
I tried everything in the tutorials and read the resources you posted. My main problem in trying to remove the post meta was that my theme, Executive Pro, relocated the "post info" with a higher priority so everything I tried wasn't working.
Basically, this part in my functions.php file does what I was looking for in case anyone can follow my convoluted thread here and wonders about the solution.
//* Relocate the post info remove_action( 'genesis_entry_header', 'genesis_post_info', 12 ); remove_action( 'genesis_entry_footer', 'genesis_post_meta' ); //* Removed from theme so meta is not added to Single Event Pages //* add_action( 'genesis_entry_header', 'genesis_post_info', 5 );
Thanks for your patience!
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.