jleone2008 Posted July 29, 2010 Share Posted July 29, 2010 I've added a download button to all of my posts using custom fields in wordpress. I know there is an easier way just not sure how. Right now I have to add the custom field on each post, instead I'd like to just have a download button (with css) automatically on all posts (download button will be going to the same url on each post). My current 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> Appreciate the help! Quote Link to comment Share on other sites More sharing options...
jleone2008 Posted July 29, 2010 Author Share Posted July 29, 2010 Nevermind just figured it out! Took me awhile but glad I learned on my own. Was actually way simpler than I thought. My code now <div id="downloadbutton"> <center><a href="mydownloadurl" target="_self"><img border="0" src="http://www.MYSITE.com/images/downloadbutton.png"></a></center> </div> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.