Wordpress 4.01
- Version de WordPress :
- Version de PHP/MySQL :
- Thème utilisé :
- Extensions en place :
- Nom de l'hebergeur :
- Adresse du site :
Problème(s) rencontré(s) :
J'ai mis sur mon sit te cette programmation
$affichage = array(0 => do_shortcode( '[sociallocker id="74"] <iframe width="95%" height="315px" src="//www.youtube.com/embed/'.$txt[1][0].'?version=3&autoplay=0&controls=0&showinfo=0&hl=fr_FR&rel=0" frameborder="0" allowfullscreen></iframe>
<br><div>
<a href="http://eepurl.com/_TLPH" target="new"><img src="http://www.comment-dessiner.edg2cp.com/img/email.png" alt="" /></a>
</div>
[/sociallocker]' ),
1 => '<iframe width="95%" height="315px" src="//www.youtube.com/embed/'.$txt[1][0].'?version=3&autoplay=0&controls=0&showinfo=0&hl=fr_FR&rel=0" frameborder="0" allowfullscreen></iframe>
<br><div>
/*----------------------Affichage banniere -------------*/
/*----------------------Affichage banniere -------------*/
</div>'
);
echo $affichage[rand(0, count($affichage))];
Entre "affichage bannière" je vous drait mettre une fonction qui affiche aléatoirement le contenu
d'article de la catégorie 3 de mon site
J'ai cette programmation
<?php
$args = array( 'posts_per_page' => 1, 'orderby' => 'rand', 'category_name' => 3 );
$rand_posts = get_posts( $args );
foreach ( $rand_posts as $post ) :
setup_postdata( $post ); ?>
<?php the_content(); ?>
<?php endforeach;
wp_reset_postdata(); ?>
Mais je ne sais pas comment l'insérer à chaque fois cela me met une erreurPourriez vous m'apporter votre aide
Merci beaucoup