Define orderby in url
-
31-10-2019 - |
Pergunta
is there a way to set the order of posts via the url?
/orderby/date/order/desc/
i have tried several things with add_rewrite_rule whiteout success.
add_action( 'init', 'wpse13483_init' );
function wpse13483_init()
{
add_rewrite_rule( 'category/(.+?)/orderby/([^/]+)/order/([^/]+)(/page/?([0-9]{1,}))?/?$', 'index.php?category_name=$matches[1]&paged=$matches[5]&orderby=$matches[2]&order=$matches[3]', 'top' );
}
best, Dan.
Nenhuma solução correta
Licenciado em: CC-BY-SA com atribuição
Não afiliado a wordpress.stackexchange