How to Add a Custom Field Download Button to WordPress Posts?

Status
Not open for further replies.

MrMoney

Member
21
2012
0
0
hello
plz i want to add a Download Button to the bottom of my WordPress posts with the ability to change the URL on every post by using a Custom Field
 
5 comments
If you want to add download text/button edit index.php and archives.php of your wordpress theme.Search for "Read More" and replace with "Download"
If you want to add custom fields and add download links/buttons use Advanced Custom Fields plugin.
 
If you want to add download text/button edit index.php and archives.php of your wordpress theme.Search for "Read More" and replace with "Download"
If you want to add custom fields and add download links/buttons use Advanced Custom Fields plugin.
thnx man
now i installed it, plz can you help me on Advanced Custom Fields Settings?
 
You can add the custom field. It is very easy.

Open single.php and paste this code where you want to display

PHP:
<?php $downlink = get_post_meta($post->ID, 'downurl', true);  
                            if($downlink !== ''){ 
                        ?>
                            <img src="URLTODOWNLOADIMAGE" width="" height="" border="" /><br />
                            <?php echo $downlink;  }
?>

Now this download link will be only single link and not multiple links.

fG8Va.png


In NAME box enter downurl and in VALUE put your filehost download link.

In the code above, replace URLTODOWNLOADIMAGE with any url of download button image.
 
Status
Not open for further replies.
Back
Top