Simple Upcoming Events
Title Break & Date Span (3 posts)

  1. pmj
    Posted 3 years ago #

    Is it possible to set the date and the title of the event appear on two lines e.g.

    Name of Event


    Also, can you create a date range for events with different start and end dates?


  2. koendewit
    Posted 3 years ago #

    Not sure about the date range, but the line break can be done.
    Find simple-upcoming-events.php and then add '<br />' . between $output .= '<li>' . $event_date . and ' <a href="' . $permalink . '">' . htmlspecialchars($post_title) . '</a>';
    So it will become:

    $output = '';
        if($posts) {
          foreach ($posts as $post) {
            $post_title = get_post_meta($post->ID, $event_name_key, true);
            if(empty($post_title)) $post_title = stripslashes($post->post_title);
            $permalink = get_permalink($post->ID);
            $event_date = date($date_format, strtotime($post->event_date));
            $output .= '<li>' . $event_date . '<br>' . ' <a href="' . $permalink . '">' . htmlspecialchars($post_title) . '</a>';
            $output .= '</li>';

    good luck!

  3. pmj
    Posted 3 years ago #

    That's great, thanks!

    How would I then make the date of the event bold? Also, is it possible to put an extra line space between each event in the list?

    Thanks for your help.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic