我正在尝试通过自定义字段使用 query_posts 函数对我的结果进行排序。
这是我编辑的 query_posts() 函数:
query_posts( "post_type=produkte&".$query_string."&orderby=Price&order=DESC" );
价格看起来像 {Euro}.{Cent} 例如 1.49。
并且 query_posts() 函数命令它不正确。结果是这样排序的:
0.49、1.99、0.99
出了什么问题?
提前致谢!
我正在尝试通过自定义字段使用 query_posts 函数对我的结果进行排序。
这是我编辑的 query_posts() 函数:
query_posts( "post_type=produkte&".$query_string."&orderby=Price&order=DESC" );
价格看起来像 {Euro}.{Cent} 例如 1.49。
并且 query_posts() 函数命令它不正确。结果是这样排序的:
0.49、1.99、0.99
出了什么问题?
提前致谢!
你可以试试这个(希望它会工作/在网上找到)
query_posts( "post_type=produkte&".$query_string."&meta_key=Price&orderby=meta_value_num&order=DESC" );
关于SO的另一个答案。