Home › Forum › Plugin e temi di WP › Utenti registrati
-
AutorePost
-
-
31 Gennaio 2009 alle 22:11 #9300Nessunowin32Partecipante
Esiste un plugins che mostri in widget in numero degli utenti registrati?
Grazie
-
2 Febbraio 2009 alle 0:06 #62062gollum1Partecipante
cerca useronline tra i plugin, è il nome del plugin, ma non mi ricordo il link.
Byez
—
Gollum1
-
2 Febbraio 2009 alle 20:20 #62094Nessunowin32Partecipante
no, mi hai frainteso
NON GLI UTETNI REGISRATI E LOGGATI IN QUEL MOMENTO IL TOTALE DEGLI UTENTI REGISTRATI AL BLOG
-
2 Febbraio 2009 alle 23:16 #62102SteveAglAmministratore del forum
se hai un file fubctions.php nel tuo tema aggiungi le seguenti linee di codice, se non lo hai crealo aggiungendo all’inzio <?php e alla fine ?>:
function conta_utenti() {
global $wpdb;
$contatore = $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->users”);
echo $contatore;
}
Poi nel tema dove ti serve mostrare il numero utenti metterai;
<?php
if (function_exists(‘conta_utenti’)) {
conta_utenti();
}
?>
Inserendolo nel codice HTML che ti serve per rendere il tutto come preferisci.
-
3 Febbraio 2009 alle 18:03 #62164Nessunowin32Partecipante
o eseguito quello che mi hai detto ma non cambia niente, sottolineo che il file lo dovuto creare
-
3 Febbraio 2009 alle 20:05 #62168SteveAglAmministratore del forum
Non cambia niente rispetto a cosa^ Perchè a me provando localmente sul tema standard mettendo la funzione in function.php e mettendo la funzione conta nel template funziona perfettamente.
-
5 Febbraio 2009 alle 18:51 #62261Nessunowin32Partecipante
forse ci sono:
allora creo il dato file poi inserisco cosà¬:
<?php
function conta_utenti() {
global $wpdb;
$contatore = $wpdb->get_var(“SELECT COUNT(*) FROM $wpdb->users”);
echo $contatore;
}
?>
poi nel widget della sidebar inserisco l’ area libera di testo o codice html libero e inserisco:
<?php
if (function_exists(‘conta_utenti’)) {
conta_utenti();
}
?>
GIUSTO?
-
5 Febbraio 2009 alle 19:04 #62265SteveAglAmministratore del forum
Il codice fornito NON è un widget e il widget di testo NON esegue il codice PHP, per farlo devi usare un plugin aggiuntivo:
http://wordpress.org/extend/plugins/php-code-widget/
se usi il widget tsto vedrai solo il codice. La funzione che ho fornito era pensata per essre inserita manualmente in un tema.
-
5 Febbraio 2009 alle 19:19 #62267Nessunowin32Partecipante
o provato ma non fa uguale
-
5 Febbraio 2009 alle 20:45 #62270SteveAglAmministratore del forum
nonso che provi o cosa fai.. a me localmente funziona perfettamente…
Ultima prova, all’inzio del file function.php del tema metti:
require_once(‘wp-load.php’);
se non va neanche cosà¬.. non so che dirti perchè ripeto a me va perfettamente.
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.