Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I wanna display today's most viewed post list ? order by custom meta = views

Is it possible ?

share|improve this question
1  
WordPress does not natively capture any stats. Are you using any plugins or services to capture such information? –  Rarst Oct 12 '11 at 22:22
    
im using my functions it updates the views cutom meta smilar to postwievs –  Fatih Toprak Oct 17 '11 at 22:47

2 Answers 2

try this:

$today->query('post_type=portfolyo&showposts=15&meta_key=views&orderby=meta_value_num&order‌​=desc');

changes is "orderby=meta_value_num"

share|improve this answer
    
great that worked thanks. –  Fatih Toprak May 12 '12 at 15:20
    
@FatihToprak Why not accept the answer then? –  Brian Fegter Aug 30 '12 at 3:37
    
What you mean Fegter ? –  Fatih Toprak Sep 12 '12 at 5:28

If you have value stored in simple enough format you can use meta_key and meta_value_num query arguments to sort by it. See Order & Orderby Parameters in Codex.

share|improve this answer
    
i did but didint work. the query code here; $today->query('post_type=portfolyo&showposts=15&meta_key=views&orderby=meta_valu‌​e&order=desc'); –  Fatih Toprak Oct 22 '11 at 15:01

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.