• I try to use orderby=date but it does not seems to work.

    So I would like to set up a custom field that my client would just go and select to set the order number they want to put to each on of there portfolios.
    What is the best way to do that ?

Viewing 15 replies - 1 through 15 (of 15 total)
  • probably need more info, you know the meta above the posts has a date link, should open an archive of posts for that date. Not sure if that’s what you mean

    Thread Starter John

    (@jtrabelsi)

    No ??
    Let’s try again :))))

    Here is the code :

    [code moderated – please use the pastebin]

    When I try to orderby=date, it doesn’t work ??

    this is your query:

    <?php $wp_query->query("post_type=portfolio&". $catinclude ."&paged=".$paged.'&showposts=500&orderby=title&order=ASC'); ?>

    is it not set to order by title? Unless I’m missing something here you are not calling the posts by date but titles.

    maybe this instead?

    <?php query_posts( $query_string . '&cat=13&monthnum=' . date( 'n', current_time( 'timestamp' ) ) );?>

    but adapted for your code?:

    <?php $wp_query->query("post_type=portfolio&". $catinclude ."&paged=".$paged.'&showposts=500&orderby=title&order=ASC'); ?>

    I may not have adapted it correctly, but this may be what you should pusrue.

    Thread Starter John

    (@jtrabelsi)

    yes it’s order by title, but I want I want it to be order by date…
    Let me try your code right now…

    (thank you :))

    Thread Starter John

    (@jtrabelsi)

    noo it does not work either… ??

    I try to replace it and I also tried this :

    <?php $wp_query->query("post_type=portfolio&". $catinclude ."&paged=".$paged.'&showposts=500&order=ASC'. date( 'n', current_time( 'timestamp' ) )); ?>

    But nothing…. ??
    The idea is just to have my client able to reorganize the posts in the order she wants. is there any other solution ?

    take a look at this:

    my-posts-orde

    Thread Starter John

    (@jtrabelsi)

    Does it works with galleries ?

    Thread Starter John

    (@jtrabelsi)

    here is the link of the page

    https://www.edite.us/designers

    I don’t know if these suggestions work, they’re just suggestions, you’ll have to try;
    this almost seems too good to be true:
    dvanced-custom-sort

    I’d check it out,

    Otherwise, I don’t think I postsed what I intended, you might try this;

    <?php $wp_query->query("post_type=portfolio&". $catinclude ."&paged=".$paged.'&cat=13&monthnum=' . date( 'n', current_time( 'timestamp' ) ) );?>

    the only problem is it specifies a category, you’d have to change the cat id, that is if it even works.

    I’m still probably not 100% on what you are trying to do, you want clients to be able to sort posts by date from the front end? Can the posts already be ordered by date, or does it need to be done on the fly, per user, and from the front end?

    i’ve only seen one plugin which does that, uses jQuery, unfortunately I’m not able to find it at the moment.

    tags can be a very flexible way to show posts in different orders, you can specify any word, and show all posts tagged with that word. I even have code to get all the posts which have a certain tag, and in a certain category. it displays the tags as a list without duplcation. If each client had there own category that might work.

    as to your question about galleries, sure. As long as it’s in a post:)

    Thread Starter John

    (@jtrabelsi)

    I still can’t make it work ??
    Why orderby=date doesn’t simply work ???

    what is the result when you try, what post order appears? And what code/method are you using, exactly?

    The idea is just to have my client able to reorganize the posts in the order she wants. is there any other solution ?

    If this is true, please concider the tags option. You can use dates as tags too, I’m pretty sure anyway.

    I set up a quick demo
    look in the sidebar. I have a tag widget showing a link to posts tagged Jan 3rd 2012.

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘How to set a order number in 'orderby'.’ is closed to new replies.