Support

Account

Home Forums General Issues Post expiration & showing posts by expiration date

Helping

Post expiration & showing posts by expiration date

    • RD101

    • January 15, 2020 at 4:30 am

    Hello –
    I am looking to set up a blog page to show posts by expiration date.

    1. So, first, I would like to add a field to be able to designate an expiration date.
    2. I would then like for blog posts to show on the blog page by expiration date, the closest to expire would be at the top.
    3. Once posts have expired I would like to be able to designate an archive page for them to show on instead of them becoming drafts or being deleted.

    I installed the Post Expirator plugin which does a fine job of setting an expiration date and then after a post expires it will move the post to another category (of my selection). The issue is that the blog page will not show the posts by expiration date. This led me to ACF. ANY and ALL help is appreciated:)

  • Hey RD101,

    as you already have a plugin to set the date and move posts to a different category, I do not quite see what ACF is supposed to accomplish here.
    In order to change the sorting on the blog page, you have to modify the main query. A quick search did not reveal any plugins to that end, so it seems you will not get around using PHP to hook into it. The plugin defines a meta key _expiration-date that can be used for sorting (cf. https://plugins.trac.wordpress.org/browser/post-expirator/trunk/post-expirator.php#L78).

    What theme are you running, is it a so-called child-theme, and do you have any experience with PHP?

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.