How to have a specify event to be sticky at first item

Home Forums Ticket Products Event Tickets Plus How to have a specify event to be sticky at first item

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #935761
    Samuel
    Participant

    I would like to know how to add sticky to certain event to always listed at first/ top items? So no matter what other upcoming events being added, the specify event which I want to highlights will always stick on top

    #935862
    Barry
    Member

    Hi Samuel,

    It might be that you need to implement this as a customization – but can you tell me where you want this to happen? Within month view, for instance, there is already a sticky event option. Do you wish to apply this to some other view (which ones if so)?

    Thanks!

    #935970
    Samuel
    Participant

    This reply is private.

    #936176
    Barry
    Member

    OK:

    1) At the bottom “UPCOMING EVENTS”. I have customise my template to pull event pro post content. But need to have the sticky function for this part

    So that does indeed look pretty custom and if I’m interpreting your remarks (along with what I see on that page) correctly it is not something that is in any way generated by our plugin (at least, it doesn’t seem to be based even on an existing view or template).

    At that level of customization, I’m afraid we’d certainly need to leave you to find your own solution for this.

    2) …/events/photo > Need to have it as a sticky first item.

    So this again will require some customization work. The first thing would be to decide how exactly you are going to mark an event as sticky.

    There are a couple of possibilities here – you could for instance ape the same system WordPress uses and store a list of sticky event IDs in the options table. Alternatively, you might use a custom/additional field to mark events as sticky.

    To actually make them float to the top of the result set, you will need to make use of existing WordPress query filters such as posts_fields, posts_join and posts_orderby (and/or some others) which will allow you to add the additional logic needed to implement this.

    I’m afraid I don’t know of any existing snippets I can point you to, so this is going to be one where you need to find your own way.

    I do wish you luck though and if you’d like to share your final solution with the community that would be awesome 🙂

     

    #940890
    Barry
    Member

    Hi! It’s been a while so I’m going to go ahead and close this thread. If we can help with anything else, though, please don’t hesitate to create new threads as needed. Thanks!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘How to have a specify event to be sticky at first item’ is closed to new replies.