Community Forums › Forums › Archived Forums › General Discussion › Breadcrumbs and others stuff
Tagged: events calendar
- This topic has 12 replies, 2 voices, and was last updated 10 years, 11 months ago by tkbmtl.
-
AuthorPosts
-
October 1, 2013 at 3:15 pm #64994tkbmtlMember
Hi,
I use Events Calendar.
I’m trying to remove the breadcrumbs and other stuff from the events list and others events pages. I put this code in my functions.php but it’s not working.
if ( tribe_is_event() ) {
remove_action( ‘genesis_entry_header’, ‘genesis_post_info’, 12 );
remove_action( ‘genesis_entry_footer’, ‘genesis_post_meta’ );
remove_action(‘genesis_before_loop’, ‘genesis_do_breadcrumbs’);
}The problem is not the remove action I think, because when I remove the IF its working. Put its working on all pages...
Thank you for your help.
October 1, 2013 at 3:48 pm #64998Brad DaltonParticipantOctober 1, 2013 at 4:00 pm #64999tkbmtlMemberHere is the link : http://www.strengthsensei.com/events/
I want to remove the breadcrumbs and the Filed Under, only for this page on the event page.
Thx
October 1, 2013 at 4:23 pm #65005Brad DaltonParticipantTry this for the breadcrumbs https://gist.github.com/wpsmith/4950715
And this for the post info http://my.studiopress.com/snippets/post-info/
You will need to add a conditional tag after the function which includes the page i.d or post/page slug for your events page.
October 1, 2013 at 4:42 pm #65008tkbmtlMemberThanks for your help, put look closely. I have no problem to remove the post info or the breadcrumbs. If I do my function with the ( ! ) all the info I want to not show are gone, but there gone for all the post..
My problem is with the condition. I don't know how to do the condition.
I tried with : tribe_is_event()
The slug is events and event put how I do the condition for the slug ?
This is working, (with the ! ) look at my URL everything is gone, but for all the pages).
add_filter('genesis_before_content', 'remove_some_stuff');
Function remove_some_stuff() {
if ( !tribe_is_event() ) { // <==== MY PROBLEM IS THE CONDITION
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
remove_action('genesis_before_loop', 'genesis_do_breadcrumbs');
}
}October 1, 2013 at 5:08 pm #65012Brad DaltonParticipantOctober 2, 2013 at 4:35 pm #65129tkbmtlMemberHi, thank you very much for your help. But nothing worked, so I decide to program some PHP stuff instead.
add_action('genesis_before_content', 'remove_some_stuff');
function remove_some_stuff(){
$pageURL = htmlentities($_SERVER["REQUEST_URI"]);
if ((strpos($pageURL, 'events') || strpos($pageURL, 'event') ) !== false) {
remove_action( 'genesis_entry_header', 'genesis_post_info', 12 );
remove_action( 'genesis_entry_footer', 'genesis_post_meta' );
remove_action('genesis_before_loop', 'genesis_do_breadcrumbs');
}
}I'm new to WordPress and I thought that using a Framework like Genesis would be easier than to use a theme and build my how child on it. But I'm not sure anymore. I feel that Genesis is very well build but adds constraints.
As I'm more of a programmer than a designer it might be easier for me, can you gave me you toughts on this if you have the time ?
Thank you.
October 2, 2013 at 4:42 pm #65132Brad DaltonParticipantPlease try the first snippet as i tested it locally and it works.
Please copy the code from the view raw link and paste it at the end of your child themes functions.php file using a text editor like Notepad++
October 2, 2013 at 4:54 pm #65136tkbmtlMemberI get an error :
NOTICE: USE OF UNDEFINED CONSTANT EVENTS
If I use 'events' or "events" its not working. It seems that Events is not a page ...
I know the problem is in the condition. I just dont know how to do the condition for the Events Calendar Events and Event
Thx
October 2, 2013 at 5:00 pm #65137Brad DaltonParticipantYes. You'll need to modify the conditional tag. Try archive:
if ( is_archive( events ) )
October 2, 2013 at 5:06 pm #65138tkbmtlMemberIts not working.
if I put :
is_archive( events )
If get : NOTICE: USE OF UNDEFINED CONSTANT EVENTS
So I put 'events' and its not working.
Thx
October 2, 2013 at 5:27 pm #65141Brad DaltonParticipantI suggest you ask the plugin developer what the correct conditional tag is for the template the plugin generates.
October 5, 2013 at 4:01 pm #65490tkbmtlMemberHi all just wanted to close this thread. I got my answer from Tribe. If you want to know if you're on a Events Calendar page the conditional tag to use is : tribe_is_event_query read more here : http://docs.tri.be/Events-Calendar/function-tribe_is_event_query.html
Thank you !
-
AuthorPosts
- The forum ‘General Discussion’ is closed to new topics and replies.