[wp-hackers] Handling the featured tags
niladam at gmail.com
Mon Jun 11 13:29:09 UTC 2012
How about using custom fields? They kinda rock if you get to know them...
Sent from my iPhone
On 11.06.2012, at 15:50, Mike Little <wordpress at zed1.com> wrote:
> On Mon, Jun 11, 2012 at 1:19 PM, Haluk Karamete <halukkaramete at gmail.com>wrote:
>> Would an algorithm like this work?
>> At save/update post time,
>> check the post's featured category status; by comparing its
>> before and after status
>> if the before and after statuses ( as far as featured cat goes )
>> are the same, do nothing special.
>> if the before status was unchecked, and the after status is
>> checked, then update a field ( WELL WHAT FIELD ? )
>> How about post_date_gmt? Right from the wp_posts? What say you?
> If you want to use a standard category (there is no need to, but it might
> be more comfortable for your users), then simply hook into the
> 'added_term_relationship' and 'deleted_term_relationship' actions, and add
> or remove a meta data field with a current timestamp. Then, in the function
> called from your theme template to retrieve these featured posts, simply
> add a reverse sort using the added timestamp meta data.
> By the way, this line:
> "checked, then update a field ( WELL WHAT FIELD ? )"
> comes across as quite rude. Using all capitals is considered the textual
> equivalent of 'shouting', and in a forum where you are asking for help,
> it's not a good idea to shout at the people you hope will help you.
> Mike Little
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
More information about the wp-hackers