Skip to content

Resources do not load with custom WP_CONTENT_DIR & WP_CONTENT_URL #27

@cnasikas

Description

@cnasikas

First of all thanks for your time and your effort creating this awesome framework.

I had installed Wordpress with yeoman wordpress generator. The wordpress installtion folder is different from the content folder.

Wordpress version : 4.0
CMB2 version : 2.0.0-beta
Localhost enviroment : Windows 7 SP1, XAMPP 3.2.1

wp-config.php

if (!defined('WP_SITEURL')) {
define('WP_SITEURL', 'http://' . $_SERVER['SERVER_NAME'] . '/ai/cms');
}
if (!defined('WP_HOME')) {
define('WP_HOME', 'http://' . $_SERVER['SERVER_NAME'] . '/ai');
}
if (!defined('WP_CONTENT_DIR')) {
define('WP_CONTENT_DIR', dirname(FILE) . '/content/');
}
if (!defined('WP_CONTENT_URL')) {
define('WP_CONTENT_URL', 'http://' . $_SERVER['SERVER_NAME'] . '/ai/content');
}

I tried to add a metabox and the resources do not load. Specifically the cmb2.min.css, jquery.timePicker.min.js, cmb2.min.js. I get a 404 error.

The problem occurs on the resources path. A trailing slash is missing at the end of the WP_CONTENT_URL.

It is http://localhost/ai/contentthemes/ai/inc/admin/cmb2/css/cmb2.min.css?ver=4.0 and should be http://localhost/ai/content/themes/ai/inc/admin/cmb2/css/cmb2.min.css?ver=4.0

If I add at the end of WP_CONTENT_URL a trailing slash is working but all permalinks have two trailing slashes.

Thanks in advance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions