• Resolved vyabsley

    (@vyabsley)


    I’m playing around with my theme’s search results page so that people can see an event date and venue when using the generic WordPress search for it.

    With the following code (mostly using existing code from the single event meta file), I have it displaying the venue, but the event time just shows up blank:

    <div>
    	<?php if( eo_is_all_day() ){
    		$date_format = 'j F Y';
    	}else{
    		$date_format = 'j F Y g:ia';
    	} ?>
                    <strong><?php _e('Start','eventorganiser'); ?>:</strong> <?php eo_the_start('$date_format'); ?><br/>
                    <strong><?php _e('Venue','eventorganiser'); ?>:</strong> <a href="<?php eo_venue_link(); ?>"> <?php eo_venue_name(); ?></a>
    </div>

    https://www.ads-software.com/extend/plugins/event-organiser/

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Stephen Harris

    (@stephenharris)

    Does the search include other post types? (i.e. is it just a generic site search, or an event-specific search)

    Thread Starter vyabsley

    (@vyabsley)

    It’s the generic site search, so blog posts show up in there too.

    Plugin Author Stephen Harris

    (@stephenharris)

    Yup, currently event occurrences only work with event-only queries. So you can obtain a post ID (and from that get a list of all occurrences, or get the next occurrence, the venue, categories etc) – but you can’t get the occurrence ID.

    It’s to do with joining the dates onto the events, but I think this can be improved (1.8?).

    Thread Starter vyabsley

    (@vyabsley)

    Ah, as long as there’s a reason why I can’t do it that’s grand. If it’s working in 1.8 then I’ll definitely have to get around to finding a donate link to give you some cash!

    Plugin Author Stephen Harris

    (@stephenharris)

    See this ticket: https://github.com/stephenharris/Event-Organiser/issues/58

    I’ve got some working code that seems to do the job. Will push the changes there in the next day or so – if you’re able to test it before I release 1.8 that would be great, but if not, no worries :).

    Thread Starter vyabsley

    (@vyabsley)

    I’m a bit dumb with WordPress still, so you’ll need to tell me which file needs edited and I’ll gladly chuck it in and test it out! ??

    Thread Starter vyabsley

    (@vyabsley)

    I’ve put the code from the github page into includes/functions.php in my theme folder, I hope that’s the right place!

    The code I pasted above is still only showing the venue and not the date, but again I’m pretty dumb with WordPress so I’m sure I’m missing something somewhere!

    Plugin Author Stephen Harris

    (@stephenharris)

    That’s for a related issue, but won’t fix what you need. The changes are fairly involved, so if you prefer you can just wait till its released. I’ll test it myself so it should ok!

    Thread Starter vyabsley

    (@vyabsley)

    I’ll wait for the next big update then, sorry about that! ??

    Plugin Author Stephen Harris

    (@stephenharris)

    Unfortunately these changes will be pretty much removed again in 1.8.3. Only event-only queries will allow for date queries. In particular to show datetimes for a particular occurrence of an event in cross-post-type queries you will need to specify the occurrence ID in the api functions.

    See this issue on github: https://github.com/stephenharris/Event-Organiser/issues/65.

    Sorry for the change!

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Showing event time in search results’ is closed to new replies.