• Resolved alantygel

    (@alantygel)


    Hi,

    First of all, thanks for the great software.

    I’m building a home page where I should have two custom post type blocks:

    1) First one showing a selected featured post, and
    2) a second one showing the 4 more recent posts except the featured one.

    I created a custom taxonomy (featured), and wanted to include in the first block posts marked as featured:yes, and in the second block posts NOT marked as featured:yes.

    Is it possible to do this, i.e., set an exclude category? (Without making user have to set featured:no). Another option would be a filter to avoid repeating posts through several blocks in the same page.

    As a side note, I tried to use sticky posts. However, if my first block is set to show one post, and the second more recent post is marked as sticky, it shows two posts. Is this a bug?

    Best,
    alan

    • This topic was modified 5 years, 10 months ago by alantygel.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Why not use “Avoid Duplicate Posts” plugin and it will prevent anything that was shown to be shown twice. It just taps into the wp-posts query so super light weight.

    As the forums say, you will need the code to ensure it works in wordpress 5.4 but just alter:

    if (!is_home())
    to
    if (!is_front_page())

    Thread Starter alantygel

    (@alantygel)

    Hi,

    Thanks for the answer! I particularly wouldn’t install a plugin with more than one year without updates and 100 installs in a production website, but I included the code into my theme and it works quite well.

    Although it solves my specific point, I would still be very happy to see the possibility of a filter that excludes a term.

    Thanks,
    alan

    Plugin Support dimned

    (@dimned)

    Hi @alantygel,
    Thank for your feedback however it is possible select the proper terms to show in this or that Custom Post Type block. We will keep your request in mind.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Exclude Category or Dont Repeat Post’ is closed to new replies.