-
Notifications
You must be signed in to change notification settings - Fork 573
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resources do not load with custom WP_CONTENT_DIR & WP_CONTENT_URL #27
Comments
Please @cnasikas, share with us the folder structure on your wordpress instalation. |
Hi First of all I want to say that on my host environment everything is working fine. Only localhost I have this problem. I guess due to different OS ? My folder structure: Root(C:\xampp\htdocs\ai) -> Haven't install CMB2 as plugin but I load it with require_once 'cmb2/init.php'; If you need anything else or my description is not enough please tell me. Thanks! |
Ok, I'll try to reproduce your setup in my Window and Mac environments, and try to identify the problem. How do you use the yeoman is easier to reproduce the environment, if you can give me only the configuration file yeoman for the settings remain identical, would help a lot. |
I use this generator https://github.com/wesleytodd/YeoPress .yeopress file: { I removed the saltKeys value because it was too long for the editor Thanks! |
I have the same problem.
plus the corresponding change to the vhost to grap the files from the correct directory. I described the same issue here reduxframework/redux-framework#1566 in some more detail. |
same here, on windows localhost im getting wrong url for css and js files |
for now i'm using filter hook like this add_filter('cmb2_meta_box_url','zaba_filter_cmb2_url'); btw you should consider using plugins_url, it works on all platforms... |
CMB2 is not always in the plugins directory. It can be bundled w/ other plugins, themes, or placed in mu-plugins. Are you using the most recent version (on github)? |
thats true, i never thought about it that way.. |
I am having a similar problem on my local hosted version of sites (Windows 7 + XAMPP). I was able to resolve the issue by modifying the Here is the modified function: function cmb2_dir( $path = '' ) { return trailingslashit( dirname( __FILE__ ) ) . $path ; } Not sure if that helps at all, but it worked for me. |
tagging @pmgarman, as he's hopefully going to do some extensive testing in windows environments. |
zabatonni's filter worked perfectly for me. thank you so much! pmgarman, please keep us updated on the status of this - your hard work is appreciated! |
Has this issue been resolved? |
@ravensorb it will likely always be an issue if using a non-standard WP installation, but that is the purpose for the |
Have you considered using something like the plugin_urls() method? |
@ravensorb just read above |
Ok, I missed the one post on using the plugins_url. It still might be worth using that as the default and then maybe providing a way to override it so that other packages to set a "root path" or "path prefix" if needed. |
@ravensorb I've pushed an update to the trunk branch that checks if CMB2 is in the plugins or mu-plugins dir, and uses plugins_url by default if so. That should address some of the issues in this thread, but please test and let me know. thank you. |
This issue should be solved for almost all use-cases now (without need to filter). If any of you are able to test with the |
i use a metabox to pick fontawesome Icon into post types - it works perfectly in local host with all plugins - WP 4.7.5 but when i run on my Host it freezes and dont respond the functionality with WP 4.7.4 with all the same plugins. |
Please any help ? what should be the main cause ? for more info i used different Tiny MCE and CMB2 plugins in the same theme .. any help will be appreciated .. <3 |
I'd do some inspecting with your browser's developer tools to check for any issues in the console and network tabs. It's really hard for us to say at all what's going on without any other information. |
look at the left side of any post in my /blog page here http://zax.themecompiler.com/blog/ there we have a logo that logo can be added or no in my dashboard post editor with my integrated metabox section , but that not active to work on this server right now that logo added as default but in my local host it works perfectly with all the same installations. is it clear now ? |
The only logos I'm seeing on the left are the skype logo with the first one shown. With dev tools, I noticed that there is a but it's not showing anything. It also appears to be missing the generic "fa" class. Is this what's supposed to show something for the second post? Not really seeing anything wrong regarding paths here, but I may be wrong. Network tab for my browser dev tools isn't showing anything for 404 errors or similar, so everything trying to be loaded, is succeeding. |
i have same reviews ,
my case is i have a metabox on dashboard's post editor - on localhost its
okay but when i turn my files into online host and server my meta box is
freezing not working if i click on Set the icon it saves skype logo by
default and directly the post editor saves the post same like share button
- i can not choose another icon from my metabox icon picker ..
can you test my screen with team viewer in background with me ?
best regards ,
themecompiler.com
…On Sun, May 28, 2017 at 9:59 AM, Michael Beckwith ***@***.***> wrote:
The only logos I'm seeing on the left are the skype logo with the first
one shown. With dev tools, I noticed that there is a but it's not showing
anything. It also appears to be missing the generic "fa" class. Is this
what's supposed to show something for the second post?
Not really seeing anything wrong regarding paths here, but I may be wrong.
Network tab for my browser dev tools isn't showing anything for 404 errors
or similar, so everything trying to be loaded, is succeeding.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AMUQlZ6p5h30xHC0eBZ8MNmZT3DJ8qNcks5r-afygaJpZM4CfR3v>
.
|
I am still curious what you're seeing with your browser dev tools and what may or may not be getting held up with the requests to the browser. This is something that can be checked on and screenshot without setting up any sort of team viewer session. Providing the code you're using on all parts may present something as well. Also anything in error logs that look suspicious or related would also help. |
I'm using the latest stable version and still facing this issue. I'm using custom WP folder structure (different WP_CONTENT_DIR). Using the cmb2_meta_box_url filter helps though. I'm using this code to fix this - just defining a constant in wp-config and using it.
|
Pretty much what the filter is for, to help aid for alternative locations or simply when CMB2 itself can't accurately locate the proper place. |
Please post a new issue, listing exact duplication instructions, and possibly others on windows systems can create a PR to address the situation. As it is now, you're commenting on a closed issue and not providing much for others to test with. |
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.
The text was updated successfully, but these errors were encountered: