Posted: April 14, 2015 at 3:35 pm
|
Hi, I’d like to hide my theme’s sidebar in every page that has to do with EE, is there a way to do it? thanks |
|
Hi, There’s a couple of things you would need to do. 1) Set any Event Espresso related pages (e.g. Registration Checkout) to use a full width Page template. Most themes come with one, but if yours does not, then you would need to create a full width page template for your theme. 2) For Events (which are a custom post type), copy the following files to your theme (ideally to a child theme): /wp-content/plugins/event-espresso-core-reg/public/Espresso_Arabica_2014/archive-espresso_events.php (you can copy the venue ones as well if you need to). Then edit the above files in your theme folder and remove or comment out the following:
You will likely need to then add new classes/ID’s to the wrapping divs and then add new CSS in order to change the width of the content, as while removing the above will remove the sidebars, it will not automatically change the width. Also, copy the espresso_pagination function found in /wp-content/plugins/event-espresso-core-reg/public/Espresso_Arabica_2014/functions.php to your theme/child theme’s functions.php file. That should get you started with removing sidebars for just Event related pages and posts. |
|
Hi Dean, Does the code below have to be modified to support the change of template?
thanks |
Hi, is the current issue that your ticket selector is appearing twice? Was the sidebar already removed in your earlier steps? — |
|
|
Hi, yes, the sidebar was removed successfully, but at the same time the ticket selector starting appearing twice. thx |
Hi, could you temporarily remove the filters and let us know what happens? https://eventespresso.com/topic/how-to-hide-sidebar-in-all-ee-associated-pages/#post-151817 — |
|
|
without the filters: |
Hi there, Could you share a link to an event so we can take a look at this issue? The filters were created for a default WP theme so your theme may be working a little differently. If you do not want to share this link here in our support forums then please email the link to the email address below and also include a link to this support post. support [at] eventespresso.com Thanks! — |
|
|
hi, I just dropped you an email. However, the moment I copy the templates to my theme directory (to remove the sidebars), the ticket selector start appearing twice. best regards |
Hi, during this step, are you swapping in the line for Event Espresso?
If not, please try these steps: https://gist.github.com/lorenzocaum/16aac08f099d7c154f04 — |
|
|
hi, yes I do. I just want to make clear that I am able to remove the sidebards and/or modify the template in any way, the problem is that the ticket-selector appears twice. That probably means that the my_remove_events_ticket I am using (https://eventespresso.com/topic/how-to-hide-sidebar-in-all-ee-associated-pages/#post-151817) stops working the moment that a single-espresso_events.php is present in theme dir. I do not know why/how I should modify the filter in order to work thanks |
The problem with using the Arabica theme files in this situation is that those 2 files call the template files within the EE4 directory which then adds is own call for the ticket selector that isn’t using a filter, so then your function doesn’t work on that ticket selector. There are two ways to work around this, you can either use more of the Arabica files (recommended to do so within a child theme) and edit the order using those, this has the same effect as the filter but you’ll need to manually change the load order within the templates. Or Copy your current themes template file and add ‘-espresso_events’ to the files, then you can make the same edit Dean recommended above. So for example, with twentyfourteen and editing single.php: Copy single.php – http://take.ms/8SOLo The sidebar should then be removed from the single events. You can also do exactly the same with archive.php for event list. Again you would likely need to add classes/ID’s to the wrapping divs and then add new CSS to make this full width. Before making any changes it is recommended to make a full site backup. |
|
The support post ‘How to hide sidebar in all EE associated pages?’ 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.