Adapting Widget "Events list"

Home Forums Calendar Products Events Calendar PRO Adapting Widget "Events list"

  • This topic has 5 replies, 2 voices, and was last updated 9 years ago by Michael.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1256602
    Michael
    Participant

    Hi guys,

    Please have a look at:http://kircheet.myhostpoint.ch

    I need to remove the button/link “find out more”.

    I am new, however I guess I have to adapt the php-file list-widget.php, line 39:

    // The URL for this widget’s “View More” link.
    $link_to_all = tribe_events_get_list_widget_view_all_link( $instance );

    However it does not work. I have attached the folder structure with the file I have adapted.

    Any idea what I am doing wrong?

    Thanks, Michael

    #1257070
    Trisha
    Member

    Hi Michael!

    What a nice site you have!  So sorry about the frustration with this widget, I can help you with this!

    You’re off to a great start we just need to take it one step further. The code that you want to remove from the template is on lines 57-61. The line of code you mentioned is the URL itself and the code to remove is the html that generates the link.

    It looks like you may be using a customized version of the Events List widget so this may or may not work depending on how the customized template is laid out.

    If removing the code from the template doesn’t work try adding the following css to your custom.css file.

    .cmsmasters_sidebar.sidebar_layout_11 .tribe-events-list-widget .cmsmasters_events_more,
    .cmsmasters_sidebar.sidebar_layout_11 .tribe-events-adv-list-widget .cmsmasters_events_more {
    display: none;
    }

    Let me know if this works out or not or if you have any further question.

    Cheers,
    Trisha

    #1257622
    Michael
    Participant

    Hi Trisha,

    Thanks for for helping me! I tried to remove the mentioned lines, however it does not solve the problem.

    Can you tell me in which foleer I can find the custom.css?

    Is it possible that I have used a widget from “The Events Calendar” instaed of the written “The Events calendar Pro”?

    Here are the programming lines of list-widget.php:

    <?php
    /**
    * Events List Widget Template
    * This is the template for the output of the events list widget.
    * All the items are turned on and off through the widget admin.
    * There is currently no default styling, which is needed.
    *
    * This view contains the filters required to create an effective events list widget view.
    *
    * You can recreate an ENTIRELY new events list widget view by doing a template override,
    * and placing a list-widget.php file in a tribe-events/widgets/ directory
    * within your theme directory, which will override the /views/widgets/list-widget.php.
    *
    * You can use any or all filters included in this file or create your own filters in
    * your functions.php. In order to modify or extend a single filter, please see our
    * readme on templates hooks and filters (TO-DO)
    *
    * @version 4.4
    * @return string
    *
    * @package TribeEventsCalendar
    *
    */
    if ( ! defined( ‘ABSPATH’ ) ) {
    die( ‘-1’ );
    }

    $events_label_plural = tribe_get_event_label_plural();
    $events_label_plural_lowercase = tribe_get_event_label_plural_lowercase();

    $posts = tribe_get_list_widget_events();

    // Check if any event posts are found.
    if ( $posts ) : ?>

      <?php
      // Setup the post data for each event.
      foreach ( $posts as $post ) :
      setup_postdata( $post );
      ?>
      <li class=”tribe-events-list-widget-events <?php tribe_events_event_classes() ?>”>
      <?php
      if (
      tribe( ‘tec.featured_events’ )->is_featured( get_the_ID() )
      && get_post_thumbnail_id( $post )
      ) {
      /**
      * Fire an action before the list widget featured image
      */
      do_action( ‘tribe_events_list_widget_before_the_event_image’ );

      /**
      * Allow the default post thumbnail size to be filtered
      *
      * @param $size
      */
      $thumbnail_size = apply_filters( ‘tribe_events_list_widget_thumbnail_size’, ‘post-thumbnail’ );
      ?>
      <div class=”tribe-event-image”>
      <?php the_post_thumbnail( $thumbnail_size ); ?>
      </div>
      <?php

      /**
      * Fire an action after the list widget featured image
      */
      do_action( ‘tribe_events_list_widget_after_the_event_image’ );
      }
      ?>

      <?php do_action( ‘tribe_events_list_widget_before_the_event_title’ ); ?>
      <!– Event Title –>

      ” rel=”bookmark”><?php the_title(); ?>

      <?php do_action( ‘tribe_events_list_widget_after_the_event_title’ ); ?>
      <!– Event Time –>

      <?php do_action( ‘tribe_events_list_widget_before_the_meta’ ) ?>

      <div class=”tribe-event-duration”>
      <?php echo tribe_events_event_schedule_details(); ?>
      </div>

      <?php do_action( ‘tribe_events_list_widget_after_the_meta’ ) ?>

      <?php
      endforeach;
      ?>

    <!– .tribe-list-widget –>

    <p class=”tribe-events-widget-link”>
    ” rel=”bookmark”><?php printf( esc_html__( ‘View All %s’, ‘the-events-calendar’ ), $events_label_plural ); ?>

    <?php
    // No events were found.
    else : ?>

    <?php printf( esc_html__( ‘There are no upcoming %s at this time.’, ‘the-events-calendar’ ), $events_label_plural_lowercase ); ?>

    <?php
    endif;

    Regards,
    Michael

    #1257725
    Trisha
    Member

    Hi Michael!

    You have the right template but I suspect your theme has created a custom template in a different directory. This is often the case with themes. Since your customization needs are fairly minimal adding some custom CSS is a very good idea.

    The easiest way to do this will be to install this plugin https://wordpress.org/plugins/simple-custom-css/ (or something similar) The instructions with the plugin should be fairly straightforward.

    I hope this helps! Have a great rest of your week 🙂

    Cheers,
    Trisha

    #1268949
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Adapting Widget "Events list"’ is closed to new replies.