• Resolved taghaboy

    (@taghaboy)


    Hi,
    I have a strange situation with the Conditional Tags who work in the search page and it dont work in the single page???
    What’s the solution please.

    <?php if($value !== get_post_custom_values("product")) {?>
    		<img src="<?php $values = get_post_custom_values("product"); echo $values[0]; ?>" title="Nom d'Art : <?php the_title(); ?>"/>
    <?php } else { ?>
    		<img src="<?php bloginfo('stylesheet_directory'); ?>/images/no-img.jpg" title="Article de blog : <?php the_title(); ?>"/>
    <?php } ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter taghaboy

    (@taghaboy)

    hallo…

    Thread Starter taghaboy

    (@taghaboy)

    Hi,
    Wow no help yet, it’s so hard to find the solution,
    OK, mybe there are some one who wait for solution, and i have the solution, so i share with you my love a bout this sweet code :

    <?php
    // Capture the custom field "product" //
    $product_photo = get_post_meta($post->ID, 'product', true);
    if ( $product_photo ) { ?>
    	<img src="<?php echo $product_photo; ?>"/>
    <?php } else { ?>
    	<img src="<?php bloginfo('stylesheet_directory'); ?>/images/no-img.jpg" title="Image indisponible"/>
    <?php } ?>

    as you see, i captur first the key i want, thene i echo it in the script.

    Good luck for any one.

    No solutions but the same problem. (I know – not very helpful!)

    Have put this in the sidebar but it doesn’t work!

    /<?php if(is_single(‘171’)) {?>
    FRED
    <?php } else {} ?>/

    (Obviously I would like something a bit more complex than FRED once I can get it to appear!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Conditional Tags dont work .’ is closed to new replies.