This question may be related to a resolved thread.
Hi guys,
I’m trying to work out a bug with a client’s News page. This is an overview page that basically displays all news items, which a user can then click in to “read more” I’m having a difficult time trying to sort these entries by “newest first”. The field is set up using Matrix with one column using the EE native date entry field. This is the field I would like to sort by. But when viewing the page, the News entries are sorting by the entry date, and not the date in the custom field. Here is my template code. It’s set up so that if no custom date is entered, it will use the entry date. The custom field name is “newsdate”. Also running EE version 2.4 Any help would be great!!
{exp:channel:entries channel="news" status="open|hidden" disable="categories|category_fields|member_data|pagination|trackbacks" start_on="2012-01-01 00:00" stop_before="2012-12-31 00:00" dynamic="no" show_future_entries="no" orderby="newsdate" sort="desc"}
{if status == 'open' || member_group == '1'} {!-- superadmins see hidden entries --}
{news_article}
<li>
{exp:ce_img:pair src="{logo}" width="100"}{made}{/exp:ce_img:pair}
<a href="http://{page_url}" title="{title}">{title}</a><span>{if newsdate == ""}{entry_date format="%m.%d.%y"}{if:else}{newsdate format="%m.%d.%y"}{/if} | <em>{source}</em></span>
{blurb}
</li>
{/news_article}
{/if}
{/exp:channel:entries}