Forums

template tag in a php echo - how??? (1 post)

  1. perthmetro
    Member
    Posted 1 year ago #

    I'm trying to get this working... but all in comes up with is the url...
    http://xyz.com.au/wordpress/wp-content/uploads/venue.jpg

    I want...
    http://xyz.com.au/wordpress/wp-content/uploads/venue64.jpg where 64 is the post ID

    <?php if ( in_category(17) || in_category (5) ) {
    echo '<a href="http://xyz.com.au/wordpress/wp-content/uploads/venue'.the_ID().'.jpg"><img class="alignright size-medium" src="http://xyz.com.au/wordpress/wp-content/uploads/venue'.the_ID().'.jpg" width="300px" title="'.the_ID().'" ></a>';
    } else {
    echo '<p>nothing here</p>';
    }
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic