Quantcast
Channel: Toolset » All Posts
Viewing all articles
Browse latest Browse all 20145

Replicate the_date function when using a custom field

$
0
0

I used to use the published date to sort posts on my page. Now I am sorting the posts with a custom date/time field.

When using the published date I used the_date function, which only shows the date once if two posts are on the same day. For example:

March 14
Headline for Post 1
Headline for Post 2 (second post on the same day)

March 13
Headline for post 3 (only one post on this day)

March 12
Headline for post 4
Headline for post 5 (second post on same day)

I use this code above the loop:

[php]<?php $paged = (get_query_var('paged')) ? get_query_var('paged') : 1; query_posts("order=asc&orderby=meta_value&meta_key=wpcf-event-date&paged=$paged"); ?></code

However, when I use the custom date the date displays above each post. How can I make the custom date field not show when two posts have the same day? Thanks.


Viewing all articles
Browse latest Browse all 20145

Trending Articles