WordPress.org

Forums

WordPress Picture / Portfolio / Media Gallery
[resolved] PDF error (2 posts)

  1. perfectas1
    Member
    Posted 10 months ago #

    I recently figured out that this plugin or the frame... supports PDF views via lightbox...so installed it and uploaded my PDF files on Image/Video URL box, but it didn't load the PDF file, instead showing the error message "Image cannot be loaded. Make sure that the path is correct and image file exists.".
    I tried to figure it out and came to install another plugin that makes lightbox load PDF files called "Easy FancyBox". The result is, now the portfolio page loads PDF files well enought, but still with the error message "Image cannot be loaded. Make sure that the path is correct and image file exists."
    I wonder what the problem is...

    my website is http://www.sideamusic.co.kr and the portfolio page is the second one on the menu.
    (The page is in Korean, so you might find it a little confusing)

    https://wordpress.org/plugins/nimble-portfolio/

  2. Nimble3
    Member
    Plugin Author

    Posted 10 months ago #

    Add following code to functions.php of your theme.

    add_filter('nimble_portfolio_get_field', 'handle_nimble_portfolio_get_field', 10, 2);
    
    function handle_nimble_portfolio_get_field ($field_value, $field) {
        if ($field == 'nimble-portfolio' && preg_match('/\b.pdf\b/i', $field_value)) {
            return $field_value."?iframe=true";
        }
        return $field_value;
    }

    You need to uninstall Easy fancybox plugin, else 2 gallery popups will be opened.

Reply

You must log in to post.

About this Plugin

  • WordPress Picture / Portfolio / Media Gallery
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.