
-
AuthorPosts
-
November 19, 2013 at 5:34 am #190457
Hello,
I need to know how to make a full-width template file to add to my Enfold Child theme. The purpose of this is to use with The Events Calendar plugin because this plugin automatically creates the events page for you and, therefore, it is not available under the ‘Pages’ section of WordPress so I can’t remove the sidebar for this specific page with the Avia layout options. The only way to change this is to select a different default template in the ‘Settings’ section for the plugin. Thus, I need to know how to create a full-width template file that I can use as the default template for this events page.
Thanks!
November 19, 2013 at 6:47 am #190470Hi stoffey99!
I have one here you can use: https://gist.github.com/DevinVinson/7540477
Cheers!
DevinNovember 19, 2013 at 10:14 am #190494Thanks Devin. That seems to do the trick. I am hoping you can help me with one more thing. On my ‘Events’ calendar page it seems to be displaying the <h1 class=’main-title entry-title’> as the title of the most recent event I created with The Events Calendar plugin. I am guessing that it has to do with this piece of code in the full-width template – if( get_post_meta(get_the_ID(), ‘header’, true) != ‘no’) echo avia_title(); – pulling the title from the most recently created event instead of displaying the static title of ‘Events’. The dynamic addition of the event title is fine for a single event page such as this: http://www.fieldbc.ca/event/friends-of-yoho-pasta-dinner/ but I would like to know if it is possible to change this page’s (http://www.fieldbc.ca/events/) <h1 class=’main-title entry-title’> to say ‘Events’ instead of ‘Yoho Blow Daze’? If so, what code would I replace in the full-width template page you sent me?
Thanks!
November 20, 2013 at 5:43 pm #191030You can remove that title and hard code your own if the plugin allows you to choose the template for the main events page.
November 20, 2013 at 8:32 pm #191126Thanks again Devin. Unfortunately, the plugin only lets you select one general template and this template is used as the wrapper for all of the pages created by the plugin. I tried replacing
if( get_post_meta(get_the_ID(), ‘header’, true) != ‘no’) echo avia_title();
with a hard coded h1 title in the template but it somewhat broke the theme and then all the single event pages had the title of ‘Event’ instead of their actual title.Is there a modification to the code – if( get_post_meta(get_the_ID(), ‘header’, true) != ‘no’) echo avia_title(); – that I can make so that it will use the title <h1 class=’main-title entry-title’>Events</h1> when there is no available title for a page but, if there is an available title, it will display that title instead?
November 20, 2013 at 8:50 pm #191128It’s all good! I got a code snippet for functions.php from Peter and it did what I wanted. Here is the link to the code snippet that should go in your functions.php file for those who may encounter the same issue: https://gist.github.com/InoPlugs/5442030
Thanks Devin and Peter.
-
AuthorPosts
- The topic ‘Full-Width Template’ is closed to new replies.