• Resolved definemedia

    (@definemedia)


    Hello there, this is a fabulous plugin and very happy with it, thinking of purchasing Pro version for mail chimp once approved by client.

    I tested the download plugin with a document here http://www.tpi.definemedia.co.uk/publications/toolbook-series/the-partnering-toolbook/ then moved to live today. Unfortunately the download icon is missing. All versions of WordPress, Divi, Plugin etc are the same.

    One live site is on https:// the staging site is not ?

    Just wondering if you could help here, the code looks exactly the same otherwise, just not accessing the font for the download icon. Any help appreciated.

    Thank you, Maria

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author mkscripts

    (@mkscripts)

    Hi,

    Thank you, good to hear you like our plugin. We appreciate it!

    For security reasons, browsers restrict cross-origin HTTP requests. If you inspect the elements in your browser you will see the following error: “… has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource”.

    The Font Awesome <link> element in the <head> section of your live site contains a different URL than the ones that are requested. The difference is the presence of “www.”.

    The solution is to add the correct headers (.htaccess / httpd.conf).

    # Apache config
    <FilesMatch ".(eot|ttf|otf|woff|woff2)">
    	Header set Access-Control-Allow-Origin "*"
    </FilesMatch>
    
    # nginx config
    if ($filename ~* ^.*?\.(eot)|(ttf)|(otf)|(woff)|(woff2)$){
    	add_header Access-Control-Allow-Origin *;
    }

    This example sets the Access-Control-Allow-Origin CORS configuration to allow pulling from all domains. You can also list domains (comma separated) if you want to pull from specific domains.

    If you have any more questions, feel free to ask.

    Kind regards,
    Team Download After Email

    Thread Starter definemedia

    (@definemedia)

    Hello there, Thanks very much for the reply. That makes sense in principle. I am using the Genesis Framework on this particular site and am struggling to find where I add this code. Is there a simple way to access the header in WordPress and update this code ? Many thanks, Maria

    Plugin Author mkscripts

    (@mkscripts)

    Hi,

    You’re welcome! You could try something like this:

    add_action( 'wp_enqueue_scripts', 'my_dae_enqueue_scripts', 20 );
    function my_dae_enqueue_scripts() {
    
        wp_dequeue_style( 'dae-fa' );
    
        $url_fa = dirname( dirname( dirname( get_stylesheet_uri() ) ) ) . '/plugins/download-after-email/css/all.css';
        wp_enqueue_style( 'my-dae-fa', str_replace( 'www.', '', $url_fa ) );
    
    }

    You can add this code to your functions.php of your child theme or via a custom plugin.

    Kind regards,
    Team Download After Email

    Thread Starter definemedia

    (@definemedia)

    Many thanks indeed for the swift response. I will give this a try tomorrow and let you know if it works. All the best, Maria

    Thread Starter definemedia

    (@definemedia)

    Unfortunately I tried both of these, adding the header script with a plugin – Insert header and footer script, and the code to the functions.php by adding it to Genesis Extender – fuctions.

    https://thepartneringinitiative.org/publications/toolbook-series/the-sdg-partnerships-guidebook/

    Unfortunately I can’t get it to access the correct font.

    I am reluctant to change site url to include the www. in WordPress which would probably fix it as it might break the live site.

    Any further suggestions for how I might get this to work ?

    Thanks very much for your help.

    Thread Starter definemedia

    (@definemedia)

    I will be building a new site soon, but this is the test pilot for the client to agree to use this so it would be good to get it working properly. If not is there something I need to make sure when I build the new site that I do in WordPress to make sure it works ? Thank you, Maria

    Plugin Author mkscripts

    (@mkscripts)

    You are welcome. You may contact us through our website so that we can help you implement one of the above codes to display the icons properly.

    Best regards,
    Team Download After Email

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Download Icon Worked on Staging but not Live’ is closed to new replies.