[wp-hackers] Alphabetise posts but ignore THE, AN, A

Martin Widmann widmann.martin at gmail.com
Mon Jun 20 07:37:23 UTC 2011


You could filter posts_orderby and return something like

REPLACE( REPLACE( REPLACE( LOWER( $wpdb->post_title, 'the ', '' ), 'an ', '' ), 'a ', '' ) ASC

Disclaimer: could have a serious impact on performance!

--
Martin Widmann



On Jun 20, 2011, at 9:25 , Baki Goxhaj wrote:

> Hi Hackers,
> 
> I've got this website <http://proverbhunter.com/> I want to alphabetise the
> posts in category, tags, and taxonomy archives but want it to ignore THE,
> AN, A in the beginning of the title. Now this post here is quite easy and
> clear: http://codex.wordpress.org/Alphabetizing_Posts But what my needs. Is
> there a way that can be achieved in WordPress?
> 
> Something that might come handy:
> http://www.sitepoint.com/forums/php-34/ignore-sort-460298.html#post3289335
> 
> Kindly,
> 
> Baki Goxhaj
> www.wplancer.com | proverbhunter.com | www.banago.info<http://proverbhunter.com>
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers



More information about the wp-hackers mailing list