BP Profile Search › Errore di elencazione in due directory con [bps_directory field_xy="abc"]
-
AuthorPost
-
Paolo
GuestHi, as by Andrea Tarantini explained in the instructions, I created two directories on the site with the shortcode [BPS_Directory] and, so that they listed two different lists of users in each of the two pages, given that the Field_202 is the one in which the user you do Register chooses if he wants to be recorded as a “student” or “professor”, on the “professors” page (https://cercoprof.it/professori/) I inserted the shortcode [bps_directory field_202 = “professor”] and on the “students” page (https://cercoprof.it/studenti/) I inserted the shortcode [bps_directory field_202 = “student”].
The problem I encountered is that the two pages never work both together: if the “professors” page correctly lists everyone and only the professors, the “students” page lists, instead, all users, including admin and professors
Sometimes, however, the “students” page works, correctly listing all the students, but, at that point, the “professors” page gives the error and publishes all users, including admin and students.
I also made the proof to use, for one of the two pages (leaving the other equal), a different mechanism: I eliminated the shortcode that uses the Field_202 and I inserted a shortcode that should only list users with a certain roleThat is, I created a “student” role and I assigned it to the users registered in the Field_202 as students, and then I replaced the shortcode that uses the Filed_202 with the shortcode [BPS_Directory Roles_Match_any = ‘student’]. Also in this configuration, one or one or the other always works of the two pages.
Does anyone know what the cause of this problem can be? What if there is a solution?
Thanks to anyone who can help me.
Salve, come da Andrea Tarantini spiegato nelle istruzioni, ho creato nel sito due directory con lo shortcode [bps_directory] e, affinché elencassero due liste diverse di utenti in ciascuna delle due pagine, premesso che il field_202 è quello nel quale l’utente che si registra sceglie se vuole essere registrato come “Studente” o “Professore”, nella pagina “Professori” (https://cercoprof.it/professori/) ho inserito lo shortcode [bps_directory field_202=”Professore”] e nella pagina “Studenti” (https://cercoprof.it/studenti/) ho inserito lo shortcode [bps_directory field_202=”Studente”].
Il problema che ho riscontrato è che le due pagine non funzionano MAI tutte e due INSIEME: se la pagina “Professori” elenca correttamente tutti e SOLO i professori, la pagina “Studenti” elenca, invece, TUTTI gli utenti, compresi gli Admin e i professori.
A volte, invece, funziona la pagina “Studenti”, elencando correttamente tutti e SOLO gli studenti, ma, a quel punto, la pagina “Professori” da l’errore e pubblica tutti gli utenti, compresi gli Admin e gli studenti.
Ho fatto anche la prova di utilizzare, per una sola delle due pagine (lasciando l’altra uguale), un meccanismo diverso: ho eliminato lo shortcode che utilizza il field_202 ed ho inserito uno shortcode che dovrebbe far elencare solo gli utenti con un determinato RUOLO. Cioè ho creato un ruolo “Studente” e lo ho assegnato agli utenti registrati nel field_202 come Studenti, e poi ho sostituito lo shortcode che utilizza il filed_202 con lo shortcode [bps_directory roles_match_any=’Studente’]. Anche in questa configurazione, delle due pagine ne funziona sempre una sola, o l’una o l’altra.
Qualcuno sa quale può essere la causa di questo problema? E se esiste una soluzione?
Grazie a chiunque possa darmi un aiuto.
Paolo
GuestI add to my post that, as further proof, I created an additional field, the field_284 that is filled with the value “Student” when someone registers as “Student”.
So now the fields are two and are different for each page, and therefore also the shortcodes: [bps_directory field_284=”Student”] for the “Students” page and [bps_directory field_202=”Professor”] for the “Professors” page. But the error remains the same.
Aggiungo al mio post che, come ulteriore prova, ho creato un ulteriore field, il field_284 che viene riempito con il valore “Studente” quando qualcuno si registra come “Studente”.
Per cui adesso i campi sono due e sono diversi per ciascuna pagina, e quindi anche gli shortcode: [bps_directory field_284=”Studente”] per la pagina “Studenti” e [bps_directory field_202=”Professore”] per la pagina “Professori”. Ma l’errore rimane lo stesso.
andrea
Plugin AuthorTo other interested readers, Paolo found that the WP Super Cache plugin prevents the normal operation of the [bps_directory] shortcode.
I don’t know that plugin very well, but if it’s possible to exclude the directory pages from caching, that would solve the problem.
-
AuthorPost