tomasdev

web development handcrafted

WP Codex

13 Dec, 2008. Written by Tom Roggero

From the WordPress Codex Page...

Parameters in the query-string style do not have to be entered in a specific order. The only real concern is assuring parameter names are spelled correctly. If legibility is a problem, you can separate parameters with a space:

<?php wp_list_authors('show_fullname=1 & feed=rss & optioncount=1'); ?>

You can also spread a query-string over several lines (note the specific format of enclosing each parameter/value pair in single quotes and a dot starting each new line):

<?php wp_list_authors(
'show_fullname=1'
.'&feed=rss'
.'&optioncount=1'
); ?>

There are a few limitations when using query-string style tags, among which you cannot pass certain characters, such as the ampersand or a quote mark (single or double). In those cases, you can use an associative array:

<?php $params = array( 'type'   => 'postbypost',
'limit'  => 5,
'format' => 'custom',
'before' => '<li>&bull;&nbsp;',
'after'  => '</li>' );
wp_get_archives($params); ?>

Important for Spanish and other languages that need the translation working... e.g: categories in Spanish is "categorías" and if you write í it wont work... :) so, important to make it in an array!

Related posts /

Leave a Reply