Help adding download button to all posts

  • Thread starter Thread starter Deleted member 109954
  • Start date Start date
D

Deleted member 109954

Guest
EDIT: Nevermind just figured it out! Brand new to php so took me awhile. :P

I have added a download button to all of my posts using custom fields in wordpress. I was wondering if there was a simpler way of doing this though, I know there is just not sure how.

My current code
Code:
<div id="downloadbutton">
<?php if(get_post_meta($post->ID, "download_link", $single = true) != ""){ ?>
    <a href="<?php echo get_post_meta($post->ID, "download_link", $single = true); ?>"<img src="http://www.MYSITE.com/images/downloadbutton.png" border="0"></a>
<?php } ?>
</div>

I have that code in my single.php file, what can I use instead so I don't have to add the custom field each time I post? BTW the download button will be going to the same URL on each post.

EDIT: Nevermind just figured it out! Brand new to php so took me awhile. :P
 
Last edited by a moderator:
Back
Top