inboundnow / retired-cta

Create Calls to Action for your WordPress site. Monitor and improve conversion rates, run A/B split tests, customize your own CTA templates and more
http://www.inboundnow.com/cta/
1 stars 3 forks source link

cta does not load templates javascript or css code in the assets directory #62

Closed pbfteambox closed 10 years ago

pbfteambox commented 10 years ago

There are a couple of bugs in the class.cta.render.php file that prevent the CSS and JS files located in the assets directory of cta templates to be loaded.

The following patch resolves this issue:

diff -up classes/class.cta.render.php.orig classes/class.cta.render.php
--- classes/class.cta.render.php.orig   2014-10-03 08:55:39.000000000 +0200
+++ classes/class.cta.render.php    2014-10-03 10:50:45.000000000 +0200
@@ -261,8 +261,8 @@ if ( !class_exists( 'CTA_Render' ) ) {
            }

            /*  Check if Dirs exist first */
-           $has_js_dir = WP_CTA_PATH.'templates/'.$template['slug'].'/assets/css/';
-           $has_style_dir = WP_CTA_URLPATH.'templates/'.$template['slug'].'/assets/js/';
+           $has_js_dir = WP_CTA_PATH.'templates/'.$template['slug'].'/assets/js/';
+           $has_css_dir = WP_CTA_PATH.'templates/'.$template['slug'].'/assets/css/';

            if(file_exists($has_js_dir)) {
                /* get js files */
@@ -276,7 +276,7 @@ if ( !class_exists( 'CTA_Render' ) ) {
                }
            }

-           if(file_exists($has_js_dir)) {
+           if(file_exists($has_css_dir)) {
                /* get css files */
                $results = scandir($template['path'].'assets/css/');
                foreach ($results as $name) {
atwellpub commented 10 years ago

@pbfteambox

Thank you I've confirmed and built in the patch, will you confirm?

pbfteambox commented 10 years ago

Yep the fix looks ok. Thanks!