[wp-hackers] How to display random post with next and previous links alphetically showed

Deepak Mittal dpac.mittal2 at gmail.com
Tue Jul 12 18:30:32 UTC 2011


Doesn't work. Everything is in random order. Any other solution?

On Tue, Jul 12, 2011 at 7:39 PM, Otto <otto at ottodestruct.com> wrote:

> I haven't tried it, but from a quick glance at the query code, this might
> work:
>
> query_posts(array('orderby'=>'rand title'));
>
> There's a single space between rand and title. So you'll get random
> posts which should then be ordered by the title.
>
> -Otto
>
>
>
> On Tue, Jul 12, 2011 at 7:57 AM, Deepak Mittal <dpac.mittal2 at gmail.com>
> wrote:
> > Hi guys,
> >
> > I am trying to display a random post on homepage using
> >  query_posts('orderby=rand')
> >
> > The problem is I want to display the next and previos post links
> > alphabetically. That is to say, if I have posts with following titles:
> >
> > Apple
> > Ball
> > Cat
> > Dog
> >
> > And if Cat is chosen as random post, the next and previous link should
> show
> > Dog and Ball respectively. Any help for achieving this would be highly
> > appreciated.
> >
> > --
> > Regards,
> > Deepak Mittal,
> > Twitter - @dpacmittal
> > _______________________________________________
> > wp-hackers mailing list
> > wp-hackers at lists.automattic.com
> > http://lists.automattic.com/mailman/listinfo/wp-hackers
> >
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>



-- 
Regards,
Deepak Mittal,
Twitter - @dpacmittal


More information about the wp-hackers mailing list