Salve, ho un problema con un codice php... uso una piattaforma wordpress con il tema arras, volevo mettere nella home page i post più commentati, ho chiesto nel forum ufficiale di arras e mi hanno risposto così:

1. Create a new file in the top level Arras directory called
"user_functions.php"
2. Open the newly created file and add the following code:
codice:
function user_featured2_query($query) {
/* Return posts with highest number of comments */
$query = array ('post_type' => 'post',
                  'order' => 'DESC',
                  'orderby' => 'comment_count',
                  'posts_per_page' =>
(int)arras_get_option('featured2_count'));
}
function user_init() {
   add_filter('arras_featured2_query', 'user_featured2_query');
}
add_action('arras_init', 'user_init', 10);
3. Open 'functions.php' from the Arras them
4. Find the following line in the file:

require_once ARRAS_LIB . '/launcher.php';
5. After the above line, add:
require_once ARRAS_DIR . '/user_functions.php';
Il problema è che aggiunto il codice e tutto mi mostra tutti i post e non solo i più commentati e per di più non me li mostra neanche in ordine, ma tutti dal più recente al più vecchio...

Qualcuno può dirmi dove sbaglio?
Grazie!

Il sito è: www.gemskeeper.net