• splatweb

    (@splatweb)


    The function is not defined when I try to call it. Please help.

    		<?php 
    		$terms = get_terms(
    			array(
    				'taxonomy' => 'product_categories',
    				'hide_empty' => false
    			)
    		);
    
    		echo '<pre>';
    		print_r($terms);
    
    		$i = 0;
    
    		foreach($terms as $term) {
    
    			if($i=0)
    			{
    			?>
    
    				<div class="product-categories left">
    
    					<div class="category-image">
    
    						<?php
    						if (function_exists('get_wp_term_image'))
    						{
    						    $meta_image = get_wp_term_image($term->term_id); 
    						}
    						?>
    
    						<?php echo $meta_image; ?>	
    
    					</div>
    
    					<div class="category-text">
    
    						<?php echo $term->description; ?>
    
    					</div>
    
    				</div>
    
    			<?php
    			} else {
    			?>
    
    				<div class="product-categories right">
    
    					<div class="category-image">
    
    						<?php
    						if (function_exists('get_wp_term_image'))
    						{
    						    $meta_image = get_wp_term_image($term->term_id); 
    						}
    						?>
    
    						<?php echo $meta_image; ?>	
    
    					</div>
    
    					<div class="category-text">
    
    						<?php echo $term->description; ?>
    
    					</div>
    
    				</div>
    
    			<?php
    			}
    
    			echo $term->term_id;
    
    		}
    		?>
    
  • The topic ‘Function is not defined’ is closed to new replies.