Breadcrumbs and others stuff

Community Forums Forums General Discussion Breadcrumbs and others stuff

This topic is: resolved

This topic contains 12 replies, has 2 voices, and was last updated by  tkbmtl 11 months, 2 weeks ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #64994

    tkbmtl
    Participant
    Post count: 8

    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.

    #64998

    braddalton
    Participant
    Post count: 9705

    Link to your site please.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #64999

    tkbmtl
    Participant
    Post count: 8

    Here 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

    #65005

    braddalton
    Participant
    Post count: 9705

    Try 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.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #65008

    tkbmtl
    Participant
    Post count: 8

    Thanks 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’);
    }
    }

    #65012

    braddalton
    Participant
    Post count: 9705

    Is events a page or post?

    https://gist.github.com/braddalton/6786632


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #65129

    tkbmtl
    Participant
    Post count: 8

    Hi, 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.

    #65132

    braddalton
    Participant
    Post count: 9705

    Please 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++


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #65136

    tkbmtl
    Participant
    Post count: 8

    I 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

    #65137

    braddalton
    Participant
    Post count: 9705

    Yes. You’ll need to modify the conditional tag. Try archive:
    [php]
    if ( is_archive( events ) )
    [/php]


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #65138

    tkbmtl
    Participant
    Post count: 8

    Its 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

    #65141

    braddalton
    Participant
    Post count: 9705

    I suggest you ask the plugin developer what the correct conditional tag is for the template the plugin generates.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #65490

    tkbmtl
    Participant
    Post count: 8

    Hi 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 !

    • This reply was modified 11 months, 2 weeks ago by  tkbmtl.
    • This reply was modified 11 months, 2 weeks ago by  tkbmtl.
Viewing 13 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic.