Support » Plugin: VS Event List » Add linked title feature (solution)

  • Resolved martinwedgwood

    (@martinwedgwood)


    Thanks for this amazing plugin, Guido.

    With regards to this closed thread:

    I made some small adjustments by adding a few lines of code to vsel-upcoming.php starting with line 87 in order to change the title into a link:

    $event_link_start_tag = '';
    $event_link_end_tag = '';
    if(!empty($event_link)){
      $event_link_start_tag = '<a href="' . esc_url($event_link) .'"'. $link_target .'>';
      $event_link_end_tag = '</a>';
    }
    $output .= '<h4 class="vsel-meta-title">' . $event_link_start_tag . get_the_title() . $event_link_end_tag . '</h4>';

    Seems to work fine for me.

    https://wordpress.org/plugins/very-simple-event-list/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Guido

    (@guido07111975)

    Hi Martin,

    Thanks for this suggestion.

    I have to think about this, because this will replace the Read More link and I don’t know yet whether I want this or not.

    Guido

    Hi Guido,

    also wanted to wrap a link around the EVENT-Title.
    I do not want to link to an external link / or copy the permalink in the field by hand everytime i set up a new event.

    in line 87 you have:
    $output .= '<h4 class="vsel-meta-title">' . get_the_title() . '</h4>';

    is I tried the snippet by martinwedgwood,
    but it didn’t work for me.

    I tried this instead:
    $output .= '<h4 class="vsel-meta-title">' . '<a href="esc_url($event_link)" ' . get_the_title() . '</a>' . '</h4>';

    But it does not paste in the link to the event shown in get_the_title().

    In my page (not online yet) I only show 1 upcoming post with title, date, time and location. For more info I want the user to click on the title to open the full event single page.

    You got any ideas how to do this?

    please post here ( cause I already changed a lot in the plugin files)

    Plugin Author Guido

    (@guido07111975)

    Hi,

    I will look at this tonight, another user also asked me how to link the event title to the single event page. Will keep you informed.

    Guido

    Plugin Author Guido

    (@guido07111975)

    Hi again,

    To link event-title to single event page, replace the title code in both shortcode files with this:

    $output .=  '<a href="'. get_permalink() .'" rel="bookmark" title="'. get_the_title() .'">'. get_the_title() .'</a>';

    I think I will add this feature (with on/off switch) in next update as well!

    Guido

    Plugin Author Guido

    (@guido07111975)

    Hi Martin and daDirtyD,

    I have updated plugin with feature to link the event title to the single event. Enjoy!

    Guido

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add linked title feature (solution)’ is closed to new replies.