Remove the Link to EVENT CATEGORY and ORGANIZER

Home Forums Calendar Products Events Calendar PRO Remove the Link to EVENT CATEGORY and ORGANIZER

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1005620
    Jan
    Participant

    Hello there!
    First of all: I love your plugin, thanks for the effort you guys are putting on it.
    I saw a couple of threads regarding this topic, but haven’t been able to find a solution for my specific problem.

    On the Events Single page, I want to remove the links to the Event Organizer and the Category of Events (I want to keep these titles, but not to be linked to anything) Please check attachment
    de-linking

    Could you give me a hint on how to do this?

    Thanks in advance!

    #1006047
    Geoff
    Member

    Hello Jan,

    Good question and I’d be happy to help as best I can!

    First off, you’ll want to override one of the calendar templates that make up the single event post:

    • details.php : located at /wp-content/plugins/the-events-calendar/src/views/modules/meta/details.php

    Make a copy of that template, then:

    • Make a new folder in your theme directory called tribe-events
    • Make a new folder in that one called modules
    • Make a new folder in that one called meta
    • Drop the template file in that last folder

    Now that the templates are in your theme, they can be modified to suit your needs. In this case, you’ll want to replace the following in details.php (lines 104-117 for me):

    <?php
    echo tribe_get_event_categories(
    get_the_id(), array(
    'before' => '',
    'sep' => ', ',
    'after' => '',
    'label' => null, // An appropriate plural/singular label will be provided
    'label_before' => '<dt>',
    'label_after' => '</dt>',
    'wrap_before' => '<dd class="tribe-events-event-categories">',
    'wrap_after' => '</dd>',
    )
    );
    ?>

    …with something like this:

    <dt> <?php esc_html_e( 'Cost:', 'the-events-calendar' ) ?> </dt>
    <dd class="tribe-events-event-cost"> <?php esc_html_e( $cost ); ?> </dd>
    <?php endif ?>
    
    <dd class="tribe-events-event-categories">
    <dt>Category:</dt>
    <?php
    $terms = get_the_terms(get_the_ID(), 'tribe_events_cat');
    $count = count($terms);
    if ( $count > 0 ){
    foreach ( $terms as $term ) {
    echo $term->name;
    }
    }
    ?>
    </dd>

    And, to remove the Organizer link, you can add this to your theme’s functions.php file:

    add_filter( 'tribe_get_organizer', 'strip_tags', 20 );

    Will this work for you? Please let me know. 🙂

    Geoff

     

    #1007376
    Jan
    Participant

    Dear Geoff, thanks for your assistance.

    While the second fix (to remove the Organizer link) worked well, I haven’t yet fixed the first point (removing the link to the category).

    I created the folders properly following your instructions but when I use the details.php file with the modified lines 104-117, all the description boxes disappear and the post stops after the Google Kalender / Ical Export links (Please check attachment)

    Any idea why?

    Thanks in advance for your support.

    #1007388
    Jan
    Participant

    Hey Geoff,
    Nevermind, we decided that it’s also cool and functional to have a link to the Events Category, so we’ll keep it.

    Thanks for your support.

    #1007527
    Geoff
    Member

    My pleasure and thanks for following up!

    I’ll go ahead and close this thread but do please hit us up if there’s anything else we can do to help. 🙂

    Cheers!
    Geoff

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Remove the Link to EVENT CATEGORY and ORGANIZER’ is closed to new replies.