Mike DiNardo

Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • Mike DiNardo
    Participant

    I finally figured it out on my own with what I think is a counter-intuitive approach:

    `echo ‘<a href=”‘ . esc_url( tribe_get_event_link( $event->ID ) ) . ‘”>’ .
    tribe_event_featured_image($event->ID, ‘thumbnail’, false) . ‘</a>’;`

    I had to first set the link parameter to “false” so it wouldn’t link to wherever Events Calendar links to in its own function call (there’s obviously a problem there). Then I just wrapped the image in the same link that EC wraps the

    tag in…

    in reply to: Link featured image to event #1188875
    Mike DiNardo
    Participant

    This reply is private.

    Mike DiNardo
    Participant

    Hi Nico,

    We’re trying to make the edits locally and linked to the live site so you could at least see what we have and what we want to do. On the home page of http://theirvingtonwoods.org, you’ll see the week view of the events calendar. If you click on the image, it links the home page so the page jumps to the top. Instead, we’d like the thumbnail to link to the respective event detail page.

    On our local environment, we added echo tribe_event_featured_image($event->ID, ‘thumbnail’, false); so at least the image wouldn’t link to the home page.

    In trying to make it work on localhost, we tried adding these two override functions:

    function iw_tribe_get_event_link( $postId = null, $full_link = true ) {

    $url = Tribe__Events__Main::instance()->getLink( ‘single’, $postId );

    if ( ” != get_option( ‘permalink_structure’ ) ) $url = trailingslashit( $url );

    if ( $full_link ) {
    $title_args = array( ‘post’ => $postId, ‘echo’ => false );
    $name = get_the_title( $postId );
    $attr_title = the_title_attribute( $title_args );
    $link = ! empty( $url ) && ! empty( $name ) ? ‘‘ . $name . ‘‘ : false;
    } else {
    $link = $url;
    }

    return apply_filters( ‘tribe_get_event_link’, $link, $postId, $full_link, $url );
    }

    function iw_tribe_event_featured_image( $post_id = null, $size = ‘full’, $link = true ) {
    if ( is_null( $post_id ) ) {
    $post_id = get_the_ID();
    }

    /**
    * Provides an opportunity to modify the featured image size.
    *
    * @param string $size
    * @param int $post_id
    */
    $image_html = get_the_post_thumbnail( $post_id, apply_filters( ‘tribe_event_featured_image_size’, $size, $post_id ) );
    $featured_image = ”;

    /**
    * Controls whether the featured image should be wrapped in a link
    * or not.
    *
    * @param bool $link
    */
    if ( ! empty( $image_html ) && apply_filters( ‘tribe_event_featured_image_link’, $link ) ) {
    $featured_image .= ‘<div class=”tribe-events-event-image”>ID )).'”>’ . $image_html . ‘</div>’;
    } elseif ( ! empty( $image_html ) ) {
    $featured_image .= ‘<div class=”tribe-events-event-image”>’ . $image_html . ‘<br>’.$link.'</div>’;
    }

    /**
    * Provides an opportunity to modify the featured image HTML.
    *
    * @param string $featured_image
    * @param int $post_id
    * @param string $size
    */
    return apply_filters( ‘tribe_event_featured_image’, $featured_image, $post_id, $size );
    }

    Is there a simple way to do (pseudo code):

    link; ?>”>
    thumbnail_img; ?>” />

    Mike DiNardo
    Participant

    After reading the posts here (scroll to Francisco) and here, I decided to delete the event and begin again. From Dashboard > Events, I selected every instance of the event and Trashed them (I then emptied the Trash). I created the event anew and set the date start and end time of the first event; but this time, instead of using the intuitive Weekly, Monthly etc. recurrence options, I went with the less intuitive Custom option – set the date the recurrence should end (11 weeks from start for 12 weeks in total), set the recurrence interval (weekly) to every (1) week (this seems redundant); checked the day of the week the event recurs on, and the box that indicated event should occur at the same time. Success!

    p.s. The option “None” described in the PRO Recurring Events article was not initially available to me.

    ————————————-

    ISSUE #2 – Custom Fields – Thanks for the article link – I was able to add the custom fields but they appear under ‘Other’ which is easily overlooked. I’d like the new (price) fields to appear directly under the Price Field, which in my case is a range. Which files would I need to copy and place in child theme to get the new fields to display between the ‘Cost’ and ‘Event Category’ Fields?

    Mike DiNardo
    Participant

    Whoops! The second screen shot is attached this time

    Mike DiNardo
    Participant

    Hi George,

    Attached is the screen shot of the edit screen. Note: when I went to edit the event, the event is now 12 different events – the end dates of which are each wrong. A screen shot of this is attached as well. I selected the first of the twelve to edit.

    Thanks,
    Chris

Viewing 6 posts - 1 through 6 (of 6 total)