WordPress.org

Ready to get started?Download WordPress

Forums

Download Monitor
Making a download Button instead of text (10 posts)

  1. Skavenmight
    Member
    Posted 1 year ago #

    I have been able to get the plug-in working but only in text form. So there is a direct download link to a text. Is there a way to create a download button from a image? It's very confusing to me on how to use the templates.
    Can anyone help me out?

    http://wordpress.org/plugins/download-monitor/

  2. jibbius
    Member
    Posted 1 year ago #

    [download id="1173" template="button"]

    (where id is your document id)

  3. jibbius
    Member
    Posted 1 year ago #

    The templates are stored in the plugin directory.

    These:

    [download id="1173"]
    [download id="1173" template="box"]
    [download id="1173" template="button"]
    [download id="1173" template="filename"]

    Map to these php files:
    content-download.php
    content-download-box.php
    content-download-button.php
    content-download-filename.php

  4. Skavenmight
    Member
    Posted 1 year ago #

    Thank you Jibbius,

    Is there a way to replace this image in content-download-button.php? I went to the .php file in WordPress but I cannot make sense of the code. Is there a image that I could replace?

  5. jibbius
    Member
    Posted 1 year ago #

    The styling of the button is determined via css (you cannot simply edit an image; there is no image).

    The css rules currently affecting the button are:

    .download-button{text-align:center;
    	text-decoration:none;
    	padding:.75em 1em;
    	color:#fff;
    	display:block;
    	font-size:1.2em;
    	line-height:1.5em;
    	background-color:#09c;
    	background-image:-webkit-linear-gradient(#009fd4,#09c,#0086b2);
    	background-image:-moz-linear-gradient(#009fd4,#09c,#0086b2);
    	-moz-border-radius:4px;
    	-webkit-border-radius:4px;
    	border-radius:4px;
    	text-shadow:0 -1px 0 rgba(0,0,0,0.5);
    	box-shadow:0 2px 4px rgba(0,0,0,0.3),inset 0 1px 0 rgba(255,255,255,0.4);
    	border:1px solid #0086b2;
    	cursor:pointer
    }
    
    .download-button:hover{
    	color:#fff;
    	background-color:#09c;
    	background-image:-webkit-linear-gradient(#09c,#0086b2);
    	background-image:-moz-linear-gradient(#09c,#0086b2)
    }
    
    .download-button small{
    	font-size:.8em;
    	opacity:.8;
    	display:block
    }

    You need to add some css into your theme to override the styles/background-color/etc, that are applied by the plugin's "frontend.css" file.

  6. LindaEve
    Member
    Posted 12 months ago #

    This is cool - I'd like to make a very simple and small download button but I would also like it to not display the count - just the word "download" in a box. Any ideas how to accomplish that?

  7. jibbius
    Member
    Posted 12 months ago #

    Remove this line of code from content-download-button.php:

    <div class="download-count"><?php printf( _n( '1 download', '%d downloads', $dlm_download->get_the_download_count(), 'download_monitor' ), $dlm_download->get_the_download_count() ) ?></div>

    or copy everything else in that file, into a new file, content-download-button2.php
    and update your shortcode to use template="button2"
    (that way you don't have to worry about losing changes when upgrading the plugin)

  8. Skavenmight
    Member
    Posted 12 months ago #

    Hey jibbius,

    thank you for all these posts.
    I am still left with the file name in the button.
    This is my code:

    <?php
    /**
     * Download button
     */
    
    global $dlm_download, $download_monitor;
    ?>
    <p><a>the_download_link(); ?>" rel="nofollow">
    	<?php printf( __( 'Download ā€œ%sā€', 'download_monitor' ), $dlm_download->get_the_title() ); ?>
    </a></p>

    How can I remove the file name?

    Also, where should I put the CSS code to change the buttons appearance? I tried to put the code into my CSS theme and change the parameters but nothing happened. Should I disable the old code somewhere?

  9. jibbius
    Member
    Posted 12 months ago #

    delete
    , $dlm_download->get_the_title()

    add an !important tag, if you dont want your changea to be overridden by old code.

    background-image:-moz-linear-gradient(#dddddd,#09c,#222222) !important;

  10. tperri1962
    Member
    Posted 11 months ago #

    the fix ([download id="1173" template="button"]) did not work for me. I still get only text. and you need a password to enter. just use this one "v!Sp8rWgvSCX".
    thanks in advance.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.