Forum Replies Created
-
AuthorPosts
-
RobertParticipant
Understand Barry. I’ll keep plugging away at this.
RobertParticipantHi Barry,
Have activated the code as indicated and checked that the default events template is active. It’s not returning the single sidebar though.RobertParticipantActually Barry, I am using the default events template but it’s not having the effect.
I shall try a little more tonight and let you know.
Thanks,
RobRobertParticipantUnderstood Barry,
I shall open a new one.
Thank you,
Robert
RobertParticipantHi Shimatorabi and Barry,
I just thought I’d jump in to help move this along.
I also want the exact same request as Shimatorabi is asking for and am trying to work on a solution.
I’m adding the following to my functions. It should be working but it’s not quite hooking. I don’t believe it’s an issue with the genesis declarations I’m making but the conditionals for the event single pages:
add_filter(‘genesis_pre_get_option_site_layout’, ‘tribe_single_layout’);
function tribe_single_layout($opt) {
if (is_singular() && tribe_is_event())
$opt = ‘content-sidebar’;
return $opt;
}Are you sure ” if (is_singular() && tribe_is_event())” is the right in this case?
Thanks,
Rob
RobertParticipantHi Barry,
Thanks so much for replying and pointing that out. Apologies also for the blunt way in which I addressed the issue. I realise now after reading it back it might have appeared a little cold
Thank you again.RobertParticipantThanks for the response Jonah.
I’ll check out those conditionals and play around to see what works.RobertParticipantHi Johan,
I appreciate all the help so far
I took your last comment as a challenge and spent time trying to work it out, with success! However, getting the results were a little more complicated than I thought so let me post what I did for your’s and other’s reference:
(genesis related)
1) Ditched the 3 column layout for the entire site but kept it for the homepage with the following:
/*—————————————————————*/
/* Force layout on homepage
/*—————————————————————*/
add_filter(‘genesis_pre_get_option_site_layout’, ‘nagoyainfo_home_layout’);
function nagoyainfo_home_layout($opt) {
if ( is_home() )
$opt = ‘sidebar-content-sidebar’;
return $opt;
}(events calendar related)
Next, I set the template to “default page” as you suggested – As predicted everything now settled into a content-sidebar layout. (As the whole site now used this as default).However……..
The problem still existed with post-info and meta showing on all event related pages. It seems the plugin pulls the single-post template from genesis and not the page-template. If it did pull the page template then the info and meta issues wouldn’t arise.To get rid of this, 2 things (for some unexplainable reason) were required.
1) dig into the functions.php and add:
/**Remove post meta and info from events*/
add_action(‘genesis_before’, ‘remove_info’ );
function remove_info() {
if (tribe_is_month() || tribe_is_event() ) {
remove_action( ‘genesis_before_post_content’, ‘genesis_post_info’ );
remove_action( ‘genesis_after_post_content’, ‘genesis_post_meta’ );
}
}This removed the meta and post-info for the grid calendar and events upcoming list.
However, info and meta still appeared on single events and venues. I tried various other template tags in the same conditional but it kept showing.Solution: CSS
.events-single .post-meta, .events-single .post-info { display: none; }
.single-tribe_venue .post-info, .single-tribe_venue .post-meta { display:none; }This got rid of the nuisance meta and info on the remaining pages.
Questions Johan (if you have time)
1) Instead of adding this to the CSS, do you know the template tags to use in the above functions to have it apply there instead?
2) Also do you have any idea as to why the tags “tribe_is_venue()” and “tribe_is_event()” didn’t affect the meta and info in venue and single event pages?
3) Finally, why did “tribe_is_event()” influence the events list page, when logically I assumed “tribe_is_upcoming” would be the tag to do this?RobertParticipantHi Jonah,
You’re gonna hate me for this but…there are 2 issues which exist.
1) My default layout is actually a 3 column “sidebar-content-sidebar” so default throws everything into that template.
2) In activating this, for some reason my post-meta and info both show up on the event pages.RobertParticipantHi Johah,
I’m not 100% confident about using the conditionals in the functions but have been trying this:
add_filter(‘genesis_pre_get_option_site_layout’, ‘set_layouts’);
function set_layouts($layout) {if ( tribe_is_event() || tribe_is_month() && !is_tax() ) {
$layout = ‘content-sidebar’;
}
return $layout;
}What I’m finding is that the single events and venues are being adjusted according to the content-sidebar layout but nothing yet happening to the calendar main.
I will keep fiddling to see what happens with other combos but any guidance would be great.
RobertParticipantApologies also for the unorganized and slightly hard to read response – I was typing from an iPhone.
I want the “content-sidebar” layout of the single event pages to apply to the calendar and list view.
You are right – I don’t want this to apply to the other pages on the site as I have set a “sidebar – content – sidebar” layout as a site default.Thanks Barry
RobertParticipantBarry – You are most certainly correct that is exactly what I am after.
As I’m working with such a wide layout the full width is a little awkward for yes – The same “content-sidebar” look of the single event pages for the calendar and list view.By the way, my apologies for staggered responses as I’m based in Japan.
By the way,
RobertParticipantThanks Barry,
I really appreciate you help with this.
In case my response wasn’t clear – I went with the default events template as you suggested as the meta and info is stripped.
If it is possible to work out a function to force a layout change to the calendar and list view (as these are the only 2 which show full width) this would be awesome.RobertParticipantHi Barry,
Yes, so sorry for not being specific.
I tried as you suggested with the following results:
1) The meta and post info did not show = good
2) A fixed full width template – I’d prefer if possible for both the calendar and list view to keep to the content-sidebar layout.Tell me Barry, is there any way to work around the layout options?
RobertParticipantBy the way, I have played around with the functions in the theme to add this but – does nothing but brake it.
add_action(‘genesis_before’, ‘remove_info’ );
function remove_info() {
if ( is_singular (‘events’) || is_post_type_archive (‘events’)) {
remove_action( ‘genesis_before_post_content’, ‘genesis_post_info’ );
}
} -
AuthorPosts