Skip Navigation

[Closed] I have view want to show premium post 1st

This support ticket is created 3 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 3 years, 5 months ago.

Author
Posts
#2128593

Tell us what you are trying to do?

I have a view where I am showing post but I want to show premium post earlier than then normal post. So premium post come 1st and then normal post in every catagories. for premium post I have custom Field checkbox, where it checked its premium post for me. I hope got my point

Is there any documentation that you are following?

Is there a similar example that we can see?

What is the link to your site?

#2128829

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

The simplest way to do this would be to order the results by the custom field (you can apply a secondary order for the "true" underlying order).

But the problem with that approach is that when WordPress queries for posts and orders by some field, if posts don't have a value for that field then they will be excluded from the results.

So if your checkbox field saves 1 for the premium post and doesn't save anything for the others, the others would be missing from the results.

For it to work you need to make sure that the field saves something, e.g. zero, then unchecked, and that all posts have a value for the field (either 1 or zero).

The topic ‘[Closed] I have view want to show premium post 1st’ is closed to new replies.