我在dailysuit工作。de,在顶部有四个特色帖子,由某个标签定义。订单从最新到最旧。
How do I get this order randomised (and not newest to oldest)?
我试图在inc/featured内容中更改如下内容。php:// Query for featured posts.
$featured = get_posts( array(
\'numberposts\' => $settings[\'quantity\'],
\'tax_query\' => array(
array(
\'field\' => \'term_id\',
\'taxonomy\' => \'post_tag\',
\'terms\' => $tag,
),
),
) );
至// Query for featured posts.
$featured = get_posts( array(
\'numberposts\' => $settings[\'quantity\'],
\'tax_query\' => array(
array(
\'field\' => \'term_id\',
\'taxonomy\' => \'post_tag\',
\'terms\' => $tag,
),
),
\'orderby\' => \'rand\',
) );
但有两个缺陷:1. It did not work/randomise.
2. Changing this file is a bad idea. If the theme gets an update, the randomising is gone.
在儿童主题中是否有可行的解决方案?提前非常感谢。