Sur mon site, il y a sur la homepage un slider dont je joins ci-dessous le code d'affichage.
Dans ce slider, sont repris nom du produit, prix, auteur, et résumé du produit.
Le problème est que le résumé du produit est fourni encodé dans un fichier csv qui alimente la base produit quotidiennement.
Sans modification du code ci-dessous, le slider s'affiche correctement et sans bug mais avec le résumé du produit encodé.
Si je modifie la ligne qui affiche le résumé
Code : Tout sélectionner
<p> <?php echo substr(get_the_excerpt(), 0,200); ?> </p>Code : Tout sélectionner
<p> <?php echo base64_decode(substr(get_the_excerpt(), 0,200)); ?> </p>Si quelqu'un a une solution pour m'aider à me dépatouiller de ce problème, ce serait super.
Merci par avance.
Code : Tout sélectionner
<div class="slider">
<div class="main-slider">
<div class="bb-custom-wrapper">
<div id="bb-bookblock" class="bb-bookblock">
<?php while (have_posts()) : the_post();
$item_size = find_xml_value($item_xml, 'slide-thumb-size');
if (empty ($item_size)) {
$item_size = '230x330';
}
$thumbnail_id = get_post_thumbnail_id(); $thumbnail = wp_get_attachment_image_src( $thumbnail_id , $item_size ); $alt_text = get_post_meta($thumbnail_id , '_wp_attachment_image_alt', true);
$product_title= get_the_title();
$title_length = get_option(THEME_NAME_S.'_products_page_title_length');
$short_title = substr($product_title,0,$title_length); ?>
<div class="bb-item">
<div class="bb-custom-content">
<div class="slide-inner">
<div class="span4 book-holder">
<?php
if (! empty($thumbnail)) {
echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '">';
echo '<img src="' . $thumbnail[0] .'" alt="'. $alt_text .'"/>';
echo '</a>';
}else {
echo '<a href="' . get_permalink() . '" title="' . get_the_title() . '">';
$item_size_arr= explode('x',$item_size); $item_size_new_h=$item_size_arr[1]; $item_size_new_w=$item_size_arr[0];
echo '<img style="width:'.$item_size_new_w.'px; height:'.$item_size_new_h.'px; " width="'. $item_size_new_w .'px" height="'. $item_size_new_h .'px" " src="' .CP_PATH_URL.'/images/no-image.jpg" alt="no image"/>';
echo '</a>';
}
?>
<div class="clearfix"></div>
<div class="slider-meta-wrapper">
<div class="slider-cart-wrapper">
<div class="cart-btn2">
<?php do_action( 'woocommerce_after_shop_loop_item' ); ?>
</div>
</div>
<div class="slider-price-wrapper">
<div class="cart-price"> <span class="price"> <?php do_action( 'woocommerce_after_shop_loop_item_title' )?> </span></div>
</div>
</div>
</div>
<div class="span7 book-detail">
<div class="details-wrapper">
<h2 class="product-thumbnail-title port-title-color cp-title"><a href="<?php echo get_permalink(); ?>"> <?php echo $product_title; ?></a></h2>
<?php
$show_author = 'Yes';
if ($show_author == 'Yes') {
echo '<strong class="title">'.the_terms( get_the_ID(), 'product_author', get_option(THEME_NAME_S.'_translation_slider_by','by'), ', ', ' ' ). '</strong>';
}
echo '<div class="book-rating">';
do_action( 'woocommerce_after_shop_loop_item_title' );
echo '</div>';
if ($show_button == 'Yes') {
echo '<span class="shop-btn">';
do_action( 'woocommerce_after_shop_loop_item' );
echo '</span>'; }
?>
</div>
<div class="cap-holder">
<p> <?php echo substr(get_the_excerpt(), 0,200); ?> </p>
<div class="clear"></div>
<?php
if ( $readmore == 'Yes' ) {
echo '<a href="'.get_permalink().'">'.get_option(THEME_NAME_S.'_translation_slider_readmore','Read More').'</a>';
}
$thumbnail = wp_get_attachment_image_src( $slider_logo , "full" );
?>
<div class="slider-logo">
<?php echo '<img src="' . $thumbnail[0] .'" alt="Slider Logo"/>'; ?>
</div>
</div> <!--cap-holder-->
</div> <!--book details-->
</div><!--slide-inner-->
</div> <!--bb custom conten-->
</div> <!--bb item-->
<?php endwhile; ?>
</div> <!--bookblock-->
</div> <!--bb custom wrapper-->
<nav class="bb-custom-nav"> <a href="#" id="bb-nav-prev" class="left-arrow">Previous</a> <a href="#" id="bb-nav-next" class="right-arrow">Next</a> </nav>
</div><!--main slide-->
<span class="slider-bottom">
<?php echo '<img alt="Shadow" src="'.CP_PATH_URL.'/images/slider-bg.png">'; ?>
</span>
</div><!--slider-->