Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter Tigzy

    (@tigzy)

    Up!
    When I put [download_url] it gives me url with closing div like this:

    https://mywebsite/mydownload/?wpdmdl=2409</div&gt;

    Plugin Author Shahjada

    (@codename065)

    please give me your url to check

    I’m having the same exact problem.

    I want to get the raw link to use it inline without the divs that create a block ruining my content format.

    I totally agree.
    Is that possible to get only the link ?

    I solved my case by editing the wpdm-functions.php file inside the wpdm plugin folder.

    Just replaced the div tag at line 530:

    return "<div class='w3eden'>" . FetchTemplate($template, $data, 'link') . "</div>";

    with a span of my own style:

    return "<span id='my_link' class='w3eden'>" . FetchTemplate($template, $data, 'link') . "</span>";

    Hope this to come in handy for you too.

    It works, but it isn’t a good idea to edit directly the plugin code, for updates..

    No it is not an good idea to solve the problem like this. Because this solution means, you would always have to manually do the above changes again, after each and every update. And this is really error prone.

    For now I’ve turned off the plugin updates and I’m relaxed. If any major additions come up I’ll have to make the same edit by my own again.

    Meanwhile ofc I hope the developers implement this the right way…

    Yeah I hope so..

    I found a solution for the moment – creating a shortcode in functions.php.

    function ji_func_download($atts) {
    	extract( shortcode_atts( array(
    		'id' => '',
    		'name' => ''
    	), $atts) );
    	$htmlcode = '<a href="'.HOME_URL().'/?wpdmdl='.$id.'">'.$name.'</a>';
    	return $htmlcode;
    }
    add_shortcode( 'ji_download', 'ji_func_download' );

    Then, I use [ji_download id="100" name="Member list.pdf"] in a page/post instead of [wpdm_package id='100'].

    Plugin Author Shahjada

    (@codename065)

    The short-code is [wpdm_direct_link id=ID] and with custom link label [wpdm_direct_link id=ID link_label='Link Label']

    Oh, perfect. I didn’t find it anywhere, thank you ^^

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Download Link shortcode’ is closed to new replies.