StudioPress Community Forums
  StudioPress Community Forums > Forums > General Discussion
For help and support, access to your downloads, or to manage your account please log into My StudioPress.

These forums have been set to read-only so you can browse the existing topics for any questions you may have.

For general discussion on WordPress, CSS and design (NOT for support) visit the new Community Forums.
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 08-31-2010, 04:06 PM
NicktheGeek's Avatar
NicktheGeek NicktheGeek is offline
Forum Manager
 
Join Date: Feb 2010
Posts: 62,650
Default

It is possible to sort via a custom field, but it is not a simple solution and cannot be done with the widget as is.

To sort via a custom field you would need to write a function to associate the post data with the post meta in an array and then sort the data in the array before outputting the post data. This isn't a terribly easy task, which is why so many event plugins fall apart.

Basically you query your posts and then setup your array from that
PHP Code:
global $post;
$post_by_event = array();

//start your loop

//fetch your event date
$event get_post_meta($post->IDeventtrue);

//fetch post data. This is built as a string but you will likely want more than this.
$data'<h2>' get_the_title() . '</h2>' .get_the_content();

$post_by_event[$event] = $data;

//end the loop

//sort and output your array
rsort($post_by_event);
foreach (
$post_by_event as $key => $val) {
    echo 
$val;

As I said in the notations, this is really overly simplistic, but as this is a support not customization forum it should help you get to where you are going.

Also, as I said, the whole thing is really difficult to pull off correctly. In this case it would require a very specific date format to sort correctly. You would probably want a more user friendly date format/ This requires a fair bit more code to pull off.
__________________
Nick "Fred and/or George Weasley" Croft
Designs by Nick the Geek
@Nick_theGeek on Twitter

Make web design easier, get FireBug for FireFox

Want to learn more about Genesis? Check out my Genesis Explained Series

 

Tags
category, event, order, sorting

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Making post date linkable to posts from that date thesportsphysio General Discussion 6 11-25-2009 01:50 PM
php call for date modified rather than date pbulished mediatracts General Discussion 3 11-03-2009 08:57 AM
Posts with date and others without date? farouchia General Discussion 4 10-28-2009 01:54 AM
Trying to Remove Date In Posts sammith General Discussion 18 07-25-2009 09:22 PM


All times are GMT -5. The time now is 01:58 AM.

Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.