Discussion: Aide PHP/Javascript
Afficher un message
Vieux 03/06/2017, 16h13   #4
Lunacy
Membre attaché
 
Avatar de Lunacy
 
Date d'inscription: juillet 2016
Localisation: France, Paris
Messages: 325
Thanks: 27
Thanked 134 Times in 61 Posts
Pouvoir de réputation: 12
Lunacy is a glorious beacon of lightLunacy is a glorious beacon of lightLunacy is a glorious beacon of lightLunacy is a glorious beacon of lightLunacy is a glorious beacon of light
Par défaut

Pas facile à expliquer mon problème, je met le code peut-être que sa sera plus simple a comprendre:

Code PHP:
<script>
function visibilite(thingId)
{
var targetElement;
targetElement = document.getElementById(thingId) ;
if (targetElement.style.display == "none")
{
targetElement.style.display = "" ;
} else {
targetElement.style.display = "none" ;
}
}
</script>
            

                                                            
                                                            
                                                        <?php
                                                            
}

                                                            echo 
"<h3>".$category->name."</h3>"
                                                            
?>
                                                            
                        
<a href="javascript:visibilite('model');"><img src="<?php echo z_taxonomy_image_url($category->term_id); //*** recupere l'image par category ***// ?>" /> </a>


            


  


                                                            <?php 
                                                            
//*** category description ***//
                                                            
$cat_description=$category->description;
                                                            
//echo $cat_description;    

            
                                                                    
                                                                    
$slug=$category->slug;

                                                                    
$args = array(
                                                                        
'tax_query' => array(
                                                                            array(
                                                                                
'taxonomy' => 'car-list',
                                                                                
'field' => 'slug',
                                                                                
'terms' => $slug,
                                                                            )
                                                                        ),
                                                                        
'posts_per_page'=>100,
                                                                        
'orderby'=>'menu_order',
                                                                        
'order'=>'DESC'
                                                                    
);
                                                                    
                                                                    
$my_query = new WP_Query$args);
                                                                    if ( 
$my_query->have_posts() ) : while ( $my_query->have_posts() ) : $my_query->the_post();
                                                                    
$thePostID $post->ID;
                                                                        
                                                                    
$image get_post_thumb($thePostID,54,54,"menu_item_slider");
                                                                    
$image_hover get_post_thumb($thePostID,180,180,"menu_item_slider_hover");
                                                                        
                                                                    
$price=get_post_meta($thePostIDTHEME_NAME.'_price'true);
                                                                    
$description=get_post_meta($thePostIDTHEME_NAME.'_description'true);

                                                                    if(!
$price$price=0;
                                                                        
                                                                    
$currency=get_option(THEME_NAME.'_currency_category');


                                                                
?>
                                                                <div id="model" style="display:none;">    
                                                                    <table class="item">
                                                                        <tr>
                                                                            <td class="image"><a href="<?php the_permalink(); ?>" class="tTip" title="&lt;img src=&quot;<?php echo $image_hover['src'];?>&quot; alt=&quot;&quot; width=&quot;180&quot; height=&quot;180&quot; /&gt;"><img src="<?php echo $image['src'];?>" alt="" width="54" height="54"  /></a></td>
                                                                            <td class="text">
                                                                                <p class="title"><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></p>
                                                                                <p class="description"><?php echo remove_html_slashes($description);?></p>
                                                                            </td>
                                                                            <td class="menu-price"><p><?php echo $currency.remove_html_slashes($price);?></p></td>
                                                                        </tr>
                                                                    </table>
                                                                </div>
                                                                <?php
                                                                    
                                                                
endwhile; else: endif; 
                                                                    
                                                            
$n++;    
                                                
                                                            if(
$n==5) { $n=1; }
                                                        
                                                        }
//end if 
                                                        
                                                    
// end foreach

                                                
?>
                                                
                                                
                                                    <!-- END .right-side -->
                                                    </div>
Lunacy est déconnecté   Réponse avec citation