Home › Forum › Plugin e temi di WP › Slide per post ma con stessa immagine
-
AutorePost
-
-
26 Febbraio 2010 alle 16:43 #13142gabar-elPartecipante
ciao, un temp che uso ha una slide in testata prodotta da questo codice:
<script type="text/javascript">
var $jx = jQuery.noConflict();
$jx(function() {
$jx(".mygallery").jCarouselLite({
btnNext: ".next",
btnPrev: ".prev",
visible: 1,
easing: "backout",
speed: 1000
});
});
</script>
<div id="slidearea">
<div id="gallerycover">
<div class="mygallery">
-
<?php
-
<div class="mytext">
<h2>" rel="bookmark" title="Permanent Link to <?php the_title(); ?>"><?php the_title(); ?></h2>
<?php if(function_exists('the_content_limit')) { ?>
<?php the_content_limit(300); ?>
<?php } else { ?>
<?php the_excerpt(); ?>
<?php } ?>
<?php if ($preview = get_post_meta($post->ID, 'preview', $single = true)) { ?>
/timthumb.php?src=<?php echo $preview; ?>&h=180&w=400&zc=1" alt=""/>
<?php } else { ?>
/images/place1.jpg" alt="" />
<?php } ?>
</div>
$gldcat = get_option('eko_gldcat');
$gldct = get_option('eko_gldct');
$my_query = new WP_Query('category_name='.$gldcat.'&showposts='.$gldct.'');
while ($my_query->have_posts()) : $my_query->the_post();$do_not_duplicate = $post->ID;
?>
<?php endwhile; ?>
<div class="clear"></div>
</div>
</div>
</div>
Una parte specifica prende i post di una determinata categoria e li mette nella slide associandogli un'immagine, ma l'immagine è sempre la stessa. Come posso fare per far si che ad ogni post nella slide venga attribuita l'immagine che voglio?
grazie
-
<div class="mytext">
-
26 Febbraio 2010 alle 17:27 #71759wollyAmministratore del forum
nel post inserisci un campo personalizzato preview con l’indirizzo dell’immagine che vuoi?
-
1 Marzo 2010 alle 10:22 #71830gabar-elPartecipante
mmhhh… no. Forse non ho capito…
-
1 Marzo 2010 alle 11:57 #71833wollyAmministratore del forum
dove hai preso quel codice ci saranno state le istruzioni per utilizzarlo.
Leggendolo devi: inserire un campo personalizzato preview con l’indirizzo dell’immagine
-
1 Marzo 2010 alle 12:56 #71836gabar-elPartecipante
si, però come puoi vedere dalle istruzioni del template alla fine c’è un campo per le thumb e la slide, ma io nell’editor del templte quel campo non ce l’ho
-
1 Marzo 2010 alle 13:08 #71837gabar-elPartecipante
Posto la pagina del control panel del template. A me pare proprio manchi quella parte di codice, o sbaglio?
`
eliminato codice non richiesto,se vuoi mostrare codice usa servizi tipo pstebin e qui metti solo il link, come da regole del forum
-
1 Marzo 2010 alle 13:56 #71838wollyAmministratore del forum
http://www.wpitaly.it/wiki/Main/UsoCampiPersonalizzati
ti suggerisc anche di studiarti il wiki per capire come funziona wordpress e quali sono le sue varie funzioni.
-
1 Marzo 2010 alle 18:42 #71847gabar-elPartecipante
grazie, ho letto e sono riuscito a capire un pò di cose e a sistemare.
Ora ho il seguente problema:
la slide prende i post e li pubblica. Se io volessi che i post nella slide stessero solo li e non in home page come potrei fare?
-
1 Marzo 2010 alle 19:22 #71849wollyAmministratore del forum
devi escluderli dal loop utilizzando query_post
-
2 Marzo 2010 alle 8:00 #71856gabar-elPartecipante
ho dato un occhio ma mi è molto difficile capire. Puoi darmi qualche info in più? Devo fare rientrare il codice all’interno di query post? Ma cosଠfacendo non escludo anche la slide che si trova in home page?
-
2 Marzo 2010 alle 8:58 #71857gabar-elPartecipante
ho risolto semplicemente mettendo i post della slide in una categoria e lasciando gli altri fuori da essa…
grazie
-
-
AutorePost
- Devi essere connesso per rispondere a questo topic.