Risposte nei forum create
Stai visualizzando 5 post - dal 1 a 5 (di 5 totali)
-
AutorePost
-
follettinuxPartecipante
però cosଠmette nella home il classico elenco degli articoli e mette per primo l’articolo in evidenza.
Ma io non voglio l’elenco…
follettinuxPartecipanteProvato con “Metti questo articolo in evidenza nella pagina iniziale del sito”?
Grazie Titti per l’intervento. Dove sta questa opzione?
16 Gennaio 2016 alle 16:27 in risposta a: [ajax] richiamare da pagina frontend una pagina backend #119580follettinuxPartecipanteho provato a seguire quanto scritto e ho provato con un esmpio ma non mi funzione.
Nella pagina del frontend ho scritto
<?php
add_action( 'admin_footer', 'my_action_javascript' ); // Write our JS below here
function my_action_javascript() { ?>
<script type="text/javascript" >
jQuery(document).ready(function($) {
var data = {
'action': 'my_action',
'whatever': 1377
};
// since 2.8 ajaxurl is always defined in the admin header and points to admin-ajax.php
jQuery.post(ajaxurl, data, function(response) {
alert('Got this from the server: ' + response);
});
});
</script> <?php
}
?>
Invece nella pagina function.php del mio tema ho messo:
add_action( 'wp_ajax_my_action', 'my_action_callback' );
function my_action_callback() {
global $wpdb; // this is how you get access to the database
$whatever = intval( $_POST );
$whatever += 10;
echo $whatever;
wp_die(); // this is required to terminate immediately and return a proper response
}
in questo modo nella pagina frontend dovrebbe apparire il risultato di 1377 + 10 ma non succede nullafollettinuxPartecipanteCiao SteveAgl e grazie per esser intervenuto.
Sà¬, le due variabili contengono l’id della categoria, e sଠsono certo che quelle categorie contengono post
30 Maggio 2015 alle 14:14 in risposta a: pagina categoria risulta vuota se ci sono custom post type #117627follettinuxPartecipantePerfetto!
Grazie Titti, funziona benissimo.
Come si chiude il topic?
[RISOLTO]
-
AutorePost
Stai visualizzando 5 post - dal 1 a 5 (di 5 totali)