Home › Forums › Ticket Products › Event Tickets Plus › How to have a specify event to be sticky at first item
- This topic has 4 replies, 2 voices, and was last updated 11 years, 2 months ago by
Barry.
-
AuthorPosts
-
January 21, 2015 at 9:45 am #935761
Samuel
ParticipantI 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
January 21, 2015 at 1:26 pm #935862Barry
MemberHi 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!
January 21, 2015 at 5:04 pm #935970Samuel
ParticipantThis reply is private.
January 22, 2015 at 7:27 am #936176Barry
MemberOK:
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 🙂
February 9, 2015 at 6:24 am #940890Barry
MemberHi! 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!
-
AuthorPosts
- The topic ‘How to have a specify event to be sticky at first item’ is closed to new replies.
