Support

Home Forums Event Espresso Premium Yet another question about sidebar on the Event Registration page

Yet another question about sidebar on the Event Registration page

Posted: April 3, 2015 at 1:24 pm

Viewing 3 reply threads


Donald Freeman

April 3, 2015 at 1:24 pm

My custom theme assigns a standard sidebar to all posts and I want to change this behavior so that a normal post gets one sidebar and my “events” get a different sidebar (the upcoming events list).

I read through several of the forum posts that talked about getting a sidebar attached to an “event registration” page. And I believe I understand that “events” are actually just “posts”.

I’ve checked my theme and I have a single.php file which has the code:
get_sidebar(‘blog’);

I intuitively want to change “blog” to “events” but in doing so it will change the sidebar for both posts and events … no surprise. My widget section has only one sidebar setting for blog pages (posts) … I wish it had two widgets, one for blog posts and one for event espresso posts.

I read the support thread https://eventespresso.com/topic/wp-theme-sidebar-problem-ee4/ … and noticed the custom post type for Event Espresso is espresso_events but it’s not clear how I would use that information to display a different sidebar for “espresso_event posts”.

I know this is a theme issue and not an Event Espresso issue but any advice would be greatly appreciated.

Thanks!


Lorenzo Orlando Caum

  • Support Staff

April 3, 2015 at 4:36 pm

Hi Donald, that can be done. See this tutorial:

https://gist.github.com/lorenzocaum/16aac08f099d7c154f04

In step 5, be sure to use a theme template that has no sidebar. The file might be named page-fullwidth.php or page-no-sidebar.php or something similar.

If you use a file without a sidebar, then no sidebar will appear on the single event page.

Thanks


Lorenzo


Donald Freeman

April 3, 2015 at 9:36 pm

Lorenzo,

Thanks for the quick response. I’m at least hopeful at this point although my recent attempt at following the instructions did not end the way I expected. I’m clearly missing something here since the instructions seem pretty straightforward … 1) grab the espresso_arabica_2014 files … copy page.php to archive-espresso_events.php and single-espress_evetns.php and then make an edit to a single line in each file … upload files to existing theme directory. That’s my shortened version.

Nothing disastrous happened except that my single event page content and sidebar have gone missing. I can remove the 18 espresso files from my theme directory and everything goes back to the way it was … but when I put the espresso_arabica files back in the theme directory … the content and sidebar disappears.

It may be some simple syntax error … can you look at my edits below and let me know if these look okay?
single-espresso_events.php —
<div class=”article”>
<?php espresso_get_template_part( ‘content’, ‘espresso_events’ ); ?>
</div>
archive-espresso_events.php —
<div class=”article”>
<?php espresso_get_template_part( ‘loop’, ‘espresso_events’ ); ?>
</div>

Again .. thanks for any help.


Dean

April 6, 2015 at 1:53 am

Hi,

The code you showed looks ok, but it’s hard to say for sure with just a snippet like that.

It might be easier to use a plugin like Custom Sidebars, and then create a new sidebar just for the Events custom post type.

https://wordpress.org/plugins/custom-sidebars/

If you still want to use the coding method, please provide the full code for each page (Pastebin.com is very useful for that) and we can see more clearly what’s happening.

Viewing 3 reply threads

The support post ‘Yet another question about sidebar on the Event Registration page’ 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