WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Advanced Custom Fields] Sort (2 posts)

  1. aglakimsmith
    Member
    Posted 2 years ago #

    Hi, I'm pretty new to wordpress and I'm still trying to figure out codes. If there's someone out there that can help, I really appreciate it.

    I downloaded this plug-in and it seems to be exactly what I am looking for. I have two questions:

    1. How can I make the custom fields show up on my post. The fields are there in the dashboard, but not on the post itself when viewed.

    2. My custom field is "Date". Is there a way that I can sort my post by this field. I would like the oldest dates to show up first when my page is viewed.

    Thank you very much for reading this and a possible solution.

  2. aglakimsmith
    Member
    Posted 2 years ago #

    For what I was trying to do, I found this solution. I'm sure that it is not the best way, but it is what I came up with. I fixed a required custom field called "edate" and then I sorted the dates ascending. If someone has a better solution. I would gladly look and learn from it.

    <?php
    global $query_string;
    query_posts($query_string . '&meta_key=edate&orderby=meta_value&order=asc');

    if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic