Sticky Custom Posts

Forums › Forums › Search & Filter Pro › Sticky Custom Posts

Tagged: ,

Viewing 2 posts – 1 through 2 (of 2 total)
  • Anonymous
    #181893

    Hey,

    Is there a way how to have the admin choose to have some posts Stickied? (We are using Custom Posts)

    They want to have certain materials always show up first in search results.

    Trevor
    #181908

    I would add a custom field plugin like ACF, then create a field group for that Custom Post Type and add a field to it where the admin can select Sticky or Not Sticky, and use the S&F sort option to sort on the Meta Key. Note that ACF makes three keys per field, so look for the one named without a preceding underscore when selecting the key to sort on.

    Note also that every post will need to be opened and a value set and then saved, because otherwise any post with no value in that field would disappear from the results (a side effect of sorting). Make sure, therefore, that when defining the field in ACF, it has a default value of Not Sticky. You could use a logical type field or a select list (dropdown or radio button).

Viewing 2 posts – 1 through 2 (of 2 total)
Search & Filter Support
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

We also use cookies to store items in your cart as well as allowing your to login on the site.

You can adjust all of your cookie settings by navigating the tabs on the left hand side.

By continuing to use this site, you also agree to our Privacy Policy.