kim crimson
Forum Replies Created
-
Forum: Fixing WordPress
In reply to: can't sort my get_posts query numericallyGreat! That works absolutely perfectly. I had to remove the (int) though, as there are some letters in the post titles too. But thanks so much for your help! really appreciate it.
Forum: Fixing WordPress
In reply to: Sort posts in admin in numeric orderThanks,
I already tried the first solution, but it only sorts the posts alphabetically, not numeric.
But postmash worked! Thanks a lot!
Forum: Fixing WordPress
In reply to: sorting posts by custom date field not recognizing the date formatActually I figured it out. I just have to use WP’s date function date_i18n. So the custom field call looks like this:
<?php $dato = get_post_meta($post->ID, 'Dato', true); $test = explode('-',$dato); echo date_i18n('j. F Y', mktime(0,0,0,$test[1],$test[2],$test[0])); unset($test); ?>Then it displays the date in the right language. So problem solved!! Thanks for all your help t31os_!!!
Forum: Fixing WordPress
In reply to: sorting posts by custom date field not recognizing the date formatThat’s off the top of my head, but i think something along those lines would do it…
wow.. That’s working perfectly!! Now they are sorted correctly. The only remaining problem is that the months are now in English. And they have to be Danish.
I looked around the Codex and found this:
<?php setlocale(LC_ALL, 'da_DK.ISO-8859-15@euro'); echo strftime('%A %d %B, %Y',strtotime(get_the_time('j. D, Y'))); ?>But I don’t really have a clue about where to put it.. All this date stuff is pretty new to me..
Thanks so much again!
Forum: Fixing WordPress
In reply to: sorting posts by custom date field not recognizing the date formatThen as Esmi said, use the other date format, then re-arrange the data when you retrieve it.
Can you give me an excample on how to re-arrange the data when I retrieve it?
Thanks so much!
Forum: Fixing WordPress
In reply to: sorting posts by custom date field not recognizing the date formatdoes it make any difference?..
Not really, then it just puts it first, because the date starts with a 0. And even if that worked it would still sort the months alphabetically..
Forum: Fixing WordPress
In reply to: sorting posts by custom date field not recognizing the date formatJust because the date has to be displayed using format A doesn’t mean it can’t be entered as a meta value using format B.
okay, thanks! but will the dates still be sorted with format A, even though format b is displayed.
Can you give me an example of how to do this?
thanks again!
Forum: Fixing WordPress
In reply to: sorting posts by custom date field not recognizing the date formatAnyone?
Sorry to bump.. I’m just hoping this is possible to do..
Forum: Fixing WordPress
In reply to: sorting posts by custom date field not recognizing the date formatThanks, but that’s unfortunately not an option for me. The date has to be displayed this exact way.
I’ve tried many solutions, but they all turn out the same. I just need some kind of way of telling the loop that the custom field is a date in this format.
Forum: Plugins
In reply to: page cross links?Yay! Thanks alot! That was exactly what i needed..