Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

Embedding SuperCPT in a theme creates 403 error for the css and js files #42

Open
sunny04 opened this issue May 15, 2014 · 2 comments
Open

Comments

@sunny04
Copy link

sunny04 commented May 15, 2014

Hi,

I'm creating a theme and I'm trying to use SuperCPT by embedding it in the theme, by calling the super-cpt.php file from the functions.php. However I get 403 error for the supercpt.css and supercpt.js files, perhaps it's to do with how the files are loaded in the SuperCPT core.

Would really love it if this can be resolved, as it is really important for me.
Thanks!

@sixlive
Copy link

sixlive commented May 29, 2014

@sunny04 @davegaeddert

I just updated the following code in the super-cpt.php

if ( !defined( 'SCPT_PLUGIN_URL' ) )
    define( 'SCPT_PLUGIN_URL', get_template_directory_uri() . '/includes/super-cpt/' );

I keep mine in foo-theme/includes

@davegaeddert
Copy link

@sixlive mind giving this a try?

if ( !defined( 'SCPT_PLUGIN_URL' ) ) {
    if (strpos(SCPT_PLUGIN_DIR, get_template_directory()) !== -1) {
        define( 'SCPT_PLUGIN_URL', str_replace(get_template_directory(), get_template_directory_uri(), SCPT_PLUGIN_DIR) . '/' );
    } else {
        define( 'SCPT_PLUGIN_URL', plugins_url( '', __FILE__ ) . '/' );
    }
}

That's what I did in #43, I think it should work in all cases...but it'd be good to know if it doesn't for some reason.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants