WordPress.org

Ready to get started?Download WordPress

Forums

Download Shortcode
[resolved] No effect / no result (27 posts)

  1. andycog
    Member
    Posted 1 year ago #

    Hey Drew (and team)

    Thanks for this, seems great!
    Right now though, I can't get it to work.

    I'm using WP Audio player to play music, and when I write the word 'download' for example and hyper link it to the place my MP3s are kept (http://eisandnose.com/audio/)
    it brings up another audio player instead of a link.

    I've checked to see if the file made it into my wp content and it's there.
    Can't work out how to get around it... Any thoughts?

    Thanks!

    http://wordpress.org/extend/plugins/download-shortcode/

  2. andycog
    Member
    Posted 1 year ago #

    Nothing seems to be happening at all :(

    Is there a tutorial, something I should be doing or some code I should be inserting with the mp3 link?

  3. andycog
    Member
    Posted 1 year ago #

    Ah, ok scrap that...

    Is there a tutorial, something I should be doing or some code I should be inserting with the mp3 link?

    I had a go at copying some code from some of the previous threads, and now I have a white screen show up with the URL http://eisandnose.com/download/http://eisandnose.com/audio/ComaCat%E2%80%93RoundTableKnightsRemix.mp3%E2%80%B3

    the short code i've put in reads -
    [download label="Download here"]http://eisandnose.com/audio/Coma Cat - Round Table Knights Remix.mp3"[/download]

    Sorry, am an absolute novice here so wil need as detailed walkthrough as possible!

    Thank you!

  4. Drew Jaynes (DrewAPicture)
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    Hi Andy,

    First things first:
    Have you tried uploading a file without spaces in the filename? I only ask because there are many documented problems with WordPress being unable to handle files with spaces in the filenames.

    Second:
    Have you already visited Settings > Permalinks and re-saved your Permalink settings? Was WordPress able to write to your .htaccess file?

    Third:
    If the answer to the second part of the second question was no, you might try disabling rewrites just for the Download Shortcode plugin by dropping the following into your theme's functions.php file:

    add_filter( 'fds_rewrite_urls', '__return_false' );
  5. andycog
    Member
    Posted 1 year ago #

    Righto, I've done the permalinks refresh. No change there.

    What do you mean when you say write my .htaccess file?
    I've searched for it in my FTP. It appears, but opaque compared to other files.
    I'm guessing this means it's hidden? Anyway, after downloading it to my desktop it doesn't appear, so i'm not sure how i'd check if it was written or not!?

    I put that snippet into my functions.php file and it doesn't seem to do anything.
    I'm still getting that white screen on download.

    Really stuck on this one, sorry. Wish i was better at this!

  6. andycog
    Member
    Posted 1 year ago #

    My functions.php looks like this...

    require_once locate_template('/lib/utils.php'); // Utility functions
    require_once locate_template('/lib/init.php'); // Initial theme setup and constants
    require_once locate_template('/lib/admin.php'); // Back-end functions
    require_once locate_template('/lib/envato/index.php'); // Auto update
    require_once locate_template('/lib/config.php'); // Configuration and constants
    require_once locate_template('/lib/cleanup.php'); // Cleanup
    require_once locate_template('/lib/widgets.php'); // Sidebars and widgets
    require_once locate_template('/lib/template-tags.php'); // Template tags
    require_once locate_template('/lib/actions.php'); // Actions
    require_once locate_template('/lib/scripts.php'); // Scripts and stylesheets
    require_once locate_template('/lib/post-types.php'); // Custom post types
    require_once locate_template('/lib/shortcode.php'); // shortcodes
    require_once locate_template('/lib/metaboxes.php'); // Custom metaboxes
    require_once locate_template('/lib/custom.php'); // Custom functions
    add_filter( 'fds_rewrite_urls', '__return_false' );

    I'm guessing it's okay to just drop that snippet in at the end like that?

  7. Drew Jaynes (DrewAPicture)
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    What do you mean when you say write my .htaccess file?

    When you save your permalink settings, WordPress writes some information to your .htaccess file. If it saves properly, you just get the standard 'Permalink structure updated.' message at the top.

    If it doesn't save, you get a red warning at the top.

    I was asking if it saved to see if maybe WordPress was having difficulty writing to the .htaccess file.

    I put that snippet into my functions.php file and it doesn't seem to do anything.
    I'm still getting that white screen on download.

    With that snippet in your theme's functions.php file, can you copy the link URL the download shortcode generates on the front-end of your site and paste it here?

    I'm guessing it's okay to just drop that snippet in at the end like that?

    Yes, that should be fine.

  8. andycog
    Member
    Posted 1 year ago #

    ^ That. Was awesome.
    Thank you!

    Ok, where can I find this download shortcode, URL link and do you mean to post it into the functions.php?

    I think i'm missing something... Does Download Shortcode bring up a front end user menu? Because, at the moment all that seems to have happened is, i've downloaded the plugin, and it has no areas for user interaction. - will I have to write this - [download label="Download here"] and [/download] into every post?

    Sorry about this Drew, thanks for being so persevering!

  9. Drew Jaynes (DrewAPicture)
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    Sorry about this Drew, thanks for being so persevering!

    Worry not, hopefully we can figure this out together.

    Ok, where can I find this download shortcode, URL link and do you mean to post it into the functions.php?

    When you add a download shortcode to a post or page from the WordPress dashboard, it looks something like this:

    [download label="Download here"]http://eisandnose.com/audio/Coma Cat - Round Table Knights Remix.mp3"[/download]

    But when you view that link from the front-end of the site, e.g. viewing your post or page, it just looks like a link with the label of 'Download here', correct?

    I'm asking you to copy the URL that 'Download here' links to on the front-end and paste it back here to analyze.

  10. andycog
    Member
    Posted 1 year ago #

    Ooop! Sorry! Gotcha!

    http://eisandnose.com/2010/10/comba-romba/

    ignore 'Download' ... That leads to another open tab.

    'Download Here' is the one to focus on.

  11. andycog
    Member
    Posted 1 year ago #

  12. Drew Jaynes (DrewAPicture)
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    I've said this before but I'll say it again. Have you tried renaming the file so there are no spaces in the filename?

    Try renaming this:
    Coma Cat - Round Table Knights Remix.mp3
    to this:
    ComaCat-Round_Table_Knights_Remix.mp3

    Upload the new file through WordPress and create a new download shortcode. Update the post and send me the link.

  13. andycog
    Member
    Posted 1 year ago #

  14. Drew Jaynes (DrewAPicture)
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    Andy,

    Did you upload the file through WordPress or manually to a directory called /audio/ in your site's home folder?

    If you've been uploading to some directory called /audio/ in your site's home folder that's probably why it's not working.

    You can still manually upload files if you want, but you need to move your /audio/ folder to be inside of /wp-content/uploads/

  15. Drew Jaynes (DrewAPicture)
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    So for instance,

    Your original link of:

    http://eisandnose.com/audio/ComaCat-Round_Table_Knights_Remix.mp3

    Would become:

    http://eisandnose.com/wp-content/uploads/audio/ComaCat-Round_Table_Knights_Remix.mp3

    Then, your download shortcode would change from:

    [download label="Download here"]http://eisandnose.com/audio/Coma_Cat-Round_Table_Knights_Remix.mp3[/download]

    to this:

    [download label="Download here"]http://eisandnose.com/wp-content/uploads/audio/Coma_Cat-Round_Table_Knights_Remix.mp3[/download]

    If that works, you can remove that line from your theme's functions.php file.

  16. andycog
    Member
    Posted 1 year ago #

    I've uploaded all my MP3s into the Audio file of my FTP. Thus the http://eisandnose.com/audio

    I've had to manually upload the files because they are bigger than what the uploader in wordpress permits.

    Is there any way we could edit the download shortcode to permit 'audio' instead?

  17. andycog
    Member
    Posted 1 year ago #

    ^ I'll give that a try...

  18. Drew Jaynes (DrewAPicture)
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    I've uploaded all my MP3s into the Audio file of my FTP. Thus the http://eisandnose.com/audio

    I've had to manually upload the files because they are bigger than what the uploader in wordpress permits.

    That's perfectly fine, but the /audio/ directory has to be located inside the /wp-content/ directory.

    Is there any way we could edit the download shortcode to permit 'audio' instead?

    Yes, but as I said above, it needs to be located inside the /wp-content/ directory no matter what.

    You can drop this in your theme's functions.php file to allow uploading into the /wp-content/audio/ directory:

    function change_download_files_directory() {
        return 'audio';
    }
    add_filter( 'fds_download_files_directory', 'change_download_files_directory' );
  19. andycog
    Member
    Posted 1 year ago #

    Ok ok ok! So! It's working!

    Check the link - http://eisandnose.com/2010/10/comba-romba/

    If you hit 'Download' it works!
    The song is located and coded as - [download label="Download here"]http://eisandnose.com/wp-content/uploads/ComaCat-Round_Table_Knights_Remix.mp3[/download]

    I've moved the audio folder into wp-content as you said.
    The track above is not inside this audio folder.

    If you hit 'Download 2' another test track i've uploaded. It fails.
    This song is located in - [download label="Download here 2"]http://eisandnose.com/wp-content/audio/01 DJ Ease My Mind (Jakwob Remix).mp3[/download]

    What am I doing wrong here...
    So close!

    I also tried dropping in that code you wrote above to the function.php, and it breaks the working download...

  20. Drew Jaynes (DrewAPicture)
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    I also tried dropping in that code you wrote above to the function.php, and it breaks the working download...

    Yes, it will break the other download because you'd now be telling it to look in http://eisandnose.com/wp-content/audio/ instead of http://eisandnose.com/wp-content/uploads/.

    When you drop the new snippet in to functions.php, does the new link work even though the old one is broken?

    Also, don't forget to remove the original filter I had you add to functions.php now. Remove this:

    add_filter( 'fds_rewrite_urls', '__return_false' );

    Side note: When I view that link you send me to I don't see download links anywhere there.

  21. andycog
    Member
    Posted 1 year ago #

    No wayyy! Which browser are you using? This might be a problem...

    That code doesn't help the new link. it goes white screen.
    Previous code has been removed.

  22. Drew Jaynes (DrewAPicture)
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    No wayyy! Which browser are you using? This might be a problem...

    This is what I see in Firefox 19: http://cl.ly/image/1p253B2s170L

    But let's not focus on display issues here and just try to get the download links problem resolved.

    That code doesn't help the new link. it goes white screen.
    Previous code has been removed.

    Make sure to:

    1. Visit Settings > Permalinks. You need to flush your rewrite rules after removing the filter from functions.php
    2. Remove all spaces and/or symbols from the filenames
  23. andycog
    Member
    Posted 1 year ago #

    I've put that code into the functions.php and the second link doesn't work.
    It white screens again with this url - http://eisandnose.com/download/01DJEaseMyMind(JakwobRemix).mp3

    I've flushed the permalinks and it doesn't seem to have an effect.
    The first download now doesn't work.

    (Next problem... I've updated my theme, and it appears you, and the rest of the world are viewing it as the old one. It's cached somewhere. Don't suppose you've any thoughts? I found this code, which doesn't seem to work... http://wordpress.stackexchange.com/questions/87248/browser-keeps-caching-old-style-css-from-wordpress-theme)

  24. Drew Jaynes (DrewAPicture)
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    I've flushed the permalinks and it doesn't seem to have an effect.
    The first download now doesn't work.

    You took the spaces out but not the symbols. Try removing the ( and ) symbols.

    This thread is getting pretty long so I'm going to lay it out for you.

    • If you include the following filter in functions.php, files will need to live in http://eisandnose.com/wp-content/audio/:
      function change_download_files_directory() {
          return 'audio';
      }
      add_filter( 'fds_download_files_directory', 'change_download_files_directory' );
    • Filenames must not contain spaces, or other symbols other than underscores, dashes or periods.
    • If you use a download shortcode formatted like this:
      [download label="Download 2"]http://eisandnose.com/wp-content/audio/01DJEaseMyMind_JakwobRemix.mp3[/download]

      A link labeled as 'Download 2' with the following URL will be output on the front-end:

      http://eisandnose.com/download/01DJEaseMyMind_JakwobRemix.mp3
    • If you're getting white-screens, it's because the server doesn't understand the URL you're providing to it, e.g. because the filename contains spaces or symbols, or because the URL passed to the server is invalid (due to the file not existing at that location).
  25. andycog
    Member
    Posted 1 year ago #

    Understood. Thanks for your time Drew, sorry for the rally, really appreciate the help!

  26. Drew Jaynes (DrewAPicture)
    Volunteer Moderator
    Plugin Author

    Posted 1 year ago #

    Understood. Thanks for your time Drew, sorry for the rally, really appreciate the help!

    It's no problem, I just feel like we're starting to go in circles.

    I made you a short screencast recapping what I've been trying to explain. Note that there are no symbols in the filename of the mp3, nothing other than underscores, dashes or periods.

    http://screencast.com/t/bNDQGOyKZ

  27. andycog
    Member
    Posted 1 year ago #

    You sir. Are an absolute hero. Thank you so much for your time and efforts. Please go to bed now! I've sussed it, and it's all working fine.

    Can't speak more highly of how helpful you've been.
    Thank you so so much!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.