开发者

Query post using multiple custom field

开发者 https://www.devze.com 2023-03-19 06:42 出处:网络
I am using this code for showing post from \"meta_key=Date\" and it is working fine! Now i need to include another \"meta_key=Top\" using numeric meta_value into my query for showing post and ordered

I am using this code for showing post from "meta_key=Date" and it is working fine!

Now i need to include another "meta_key=Top" using numeric meta_value into my query for showing post and ordered by this meta_value but i can't figure out the function.

Can anyone help me please.

Thanks in advance, Shafin

<?php 
   $daily_date = get_option('cus_daily_date');
   query_posts("category_name=sports&meta_key=Date&orderby=meta_value&order=asc&met开发者_JAVA百科a_value=$daily_date"); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>


Look here for details http://codex.wordpress.org/Class_Reference/WP_Query#Custom_Field_Parameters

0

精彩评论

暂无评论...
验证码 换一张
取 消