• Ok, here’s the deal.

    I’m working on a blog that works as an archive. The posts are compiled into categories, which are displayed on the home page for easy navigation. I’d like to set the posts to the date that video/audio/news was originally posted, so they’ll read on a chronological order.

    But.

    I also want to have a “latest updates” section, so people can easily find the latest posts, no matter their category or original date.

    But if I set the posts to their original date, the “latest updates” will only show me the most recent archives by their original date, not the ones that were actually posted most recently.

    Is there a way around that? Can I have my “custom” dates but still call the latest created posts? Or is there a way to create a custom field that I can use to reorder the posts the way I need them to be?

    (In case it matters: I don’t necessarily need the actual post date to be displayed. I just need them to be on chronological order.)

Viewing 2 replies - 1 through 2 (of 2 total)
  • For adding the custom field this plugin will help you

    https://www.ads-software.com/plugins/advanced-custom-fields/

    And in order to reorder the post by custom field you have use like

    $args = array(
    ‘post_type’ => array( ‘post_type_1’, ‘post_type_2’, ‘post_type_3’, ‘post_type_4’, ‘post_type_5’ ),
    ‘posts_per_page’ => -1,
    ‘meta_key’ => ‘custom_field_name’,
    ‘orderby’ => ‘meta_value_num’,
    ‘order’ => ‘DESC’
    );
    $query = new WP_Query($args);

    Thread Starter breathelifein

    (@biellebrunner)

    Thanks for replying.
    But I didn’t understand a single thing I was supposed to do. o.O
    I installed the plugin and created field and all, but I still don’t get how I’m gonna use that to achieve the order I want. Where should I place that code? And how can I call back to it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Post creation date X date of the post’ is closed to new replies.