• Resolved sailormarcus

    (@sailormarcus)


    I’m trying to get all of this code

    <a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title(); ?>"><img border=1 border="#999" src="<?php echo get_post_meta($post->ID, 'article_image', true);?>" height="<?php echo get_post_meta($post->ID, 'article_image_height', true);?>" width="<?php echo get_post_meta($post->ID, 'article_image_width', true);?>"  /></a>
    
    <table width="<?php echo get_post_meta($post->ID, 'article_image_width', true);?>"><td><p class="description"><?php echo get_post_meta($post->ID, 'article_image_caption', true);?>
    </td><td align="right"><p class="descriptionright"><?php echo get_post_meta($post->ID, 'article_image_author', true);?>
    </td></table>

    appear only if (is_category() || is_home()) (and have something else appear ELSE), but I can’t get it to work. How do I make the html code read properly? At first I thought I wasn’t doing the “if” commandment properly but it seems I was, and the problem is instead related to how you call on html within a ‘<?php>’?

    I dunno that much about php, but I’ve at least tried doing it with “echo” but that didn’t work either.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter sailormarcus

    (@sailormarcus)

    I thought that if I put this before the html,
    <?php if (in_category()){ ?>

    and this below it
    <?php }>

    It’d might work but then I got
    “Parse error: syntax error, unexpected ‘>'”

    ??

    moshu

    (@moshu)

    <?php }>
    should be
    <?php } ?>
    (? left out in your code)

    Thread Starter sailormarcus

    (@sailormarcus)

    Thanks a bunch, it works now!

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘how to implement html in “<?php if…” statement?’ is closed to new replies.