Dani
Forum Replies Created
Viewing 4 replies - 1 through 4 (of 4 total)
-
Forum: Fixing WordPress
In reply to: What's the best way to a front-end user order posts?Solved it with some PHP.
Here’s the code:
<?php if( !empty($_GET['order']) ) $order=$_GET['order']; else $order='DESC'; // default if( !empty($_GET['orderby']) ) $orderby=$_GET['orderby']; else $orderby = 'Data'; // default if($order=='ASC') $orderReverse = 'DESC'; else $orderReverse = 'ASC'; ?><ul> <li><a href="<?php bloginfo('url'); ?>/?orderby=localizacao&order=<?php echo $orderReverse; ?>">Localização</a></li> </ul>Forum: Fixing WordPress
In reply to: What's the best way to a front-end user order posts?It works on “regular” loop but not in my query
query_posts(array( 'post_type'=>'portfolio', 'genero'=>'destaques', 'meta_key'=>'Data', 'orderby'=>'meta_value', 'order'=> 'ASC' ));
Any suggestion?Forum: Fixing WordPress
In reply to: What's the best way to a front-end user order posts?Doesn’t work. I’ve searched wordpress.stackexchange.com and there’s nothing more related to this. Weird. It seems to be simple but I just can’t figure it out.
Forum: Fixing WordPress
In reply to: What's the best way to a front-end user order posts?Sorry, I’m quite new to this. You mean if I add an ?order=DESC to the url it is going to change the query?
Viewing 4 replies - 1 through 4 (of 4 total)