Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #1552
    design_studio
    Participant

    Hi there, I was wondering is there a way to display today’s events only or focus on a page with events for today’s date when selecting a specific tag?
    As far as I can see taxonomy-event-tag.php is used when displaying events after tag is selected. If I choose not to show past events from the settings, the shown events after selecting a tag are starting with today’s date. However I’d like to use some of the past events as a reference, and currently they are displayed as well. So if I select a tag, on the page are displayed all events under it.
    I tried to use some php code from wordpress codex as well from other sources which offer filtering the posts (events) by day, month, year and most of these has to be inserted before the loop or just before the while statement. However I only see blank page. Probably because of my limited php knowledge I can’t hook the day sorting code to the event start date variable. Any help or advice will be much appreciated. Thanks

    #1553
    design_studio
    Participant

    Just a quick update on my original post – even with Show past events option disabled, events shown on the page after selecting a certain tag are displayed randomly and still include past events. So how to show only today’s event?

    #1555
    Bartosz
    Keymaster

    Please post a link to your site and a specific page where you’d like to display single day events.

    #1711
    design_studio
    Participant

    Hello and Happy New Year. I apologise I didn’t respond earlier but I wasn’t around. I hope you had a lovely Christmas.

    So back to my question – here is the link to the website – http://featured-events.co.uk/. Basically the page where I want to use this is any tag or category page – for example you select any tag or page from tag/category list and it will be great if the first event on that page is for the current day (if there are events of course). Currently the events are displayed randomly.

    Thanks for the help in advance.
    Kind regards

    #1713
    Bartosz
    Keymaster

    Thank you, I hope you did too :)

    When it comes to your question, it looks to me as all your events, in category and tag archives (and events archive as well) are displayed using ascending date order (not randomly). In that case, what is the final effect you’d like to achieve?

    #1714
    design_studio
    Participant

    Hi, yes they are actually displayed using ascending date order (I’ve changed that). To be more clear you can select “free” category from the widget. The first event you’ll see is from November (as I’ve selected to display past events). And on the page number 4 there is an event for this year in January somewhere in the middle. Is it possible to display event for the same day or the closest to the date at the top of the first page, without deactivating past events. Thanks

    P.S. This is totally different from the topic but I’ve recently noticed it – if you choose the option that event is all day and past events are set to expire, the event disappears at 0.01am on the day – is there a chance the plugin to expire the event at the end of the day after the event is finished – for example 23.59?

    Hope this is more clear. And please, I hope you don’t get me wrong, the plugin is great and everything works ok the way it is, this are just small things, which I find while using it and I am only asking if there is an easy solution for them and if they all worth fixing/adding to the plugin. I am still happy with the plugin options and how it works – thanks for creating it!!!

    #1715
    Bartosz
    Keymaster

    Those are very good questions, so thank you for asking them, really :)

    It might be easier to answer the second one – what is your settings for “Expire current event”? If you have that disabled all day events should be displayed as you described.

    When it comes to your first question, I’m sure it can be done. However it would require some query experiments with the use of event start, end and date range parameters. Basically I’d try modifying your event-category and event-tag (or other) archive pages to use 2 custom queries, one for current day events and second for the others. Second option that may work here is using sticky posts for custom post types, where sticky would mean current day events (an example: http://www.wpbeginner.com/wp-tutorials/how-to-add-sticky-posts-in-custom-post-type-archives/). There is also an option to use custom sorting (or grouping, an example for grouping by year: http://wordpress.org/support/topic/list-all-posts-on-a-page-split-them-by-year).

    In most cases you’d propably need to use pre_get_posts filter (very helpful when working with WP_Query).

    That’s all I can think of for the moment, but there might be other (and maybe more simple) solutions.

    #1716
    design_studio
    Participant

    Thank you for answering so quickly again!

    I must admit although it will sound funny – I think I somehow missed “Expire current event” option focusing only on the past event:).

    About the second part – thank you for pointing me into the right direction. I’ll give that sticky custom post a try, I think it will do the job. I supposed that the thing I was asking is achievable somehow with writing extra queries, but as I said I am not very good with PHP. Although I tried couple of things which seemed to work but only if I use it for direct wordpress queries. Trying to cross all the wordpress and plugin variables just didn’t work for me:). Thats why decided to ask here. Thanks again.
    Kind regards.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.