Reputation: 8339
The theme options panel does not load correctly with certain themes on OpenShift. I am using Avada theme of wordpress that is built using Redux framework. Everything works perfect on localhost but when I host the site on openshift, the "theme options" doesn't work and FireBug's console shows that the stylesheet and script paths are messed up by openshift.
The current (invalid) url for an example stylesheet is like this:
https://my-website.com/wp-content/var/lib/openshift/5942968f2d527198350000f2/app-root/data/themes/themeName/includes/lib/inc/redux/framework/FusionReduxCore/inc/extensions/import_export/import_export/field_import_export.css
While it should be this:
https://my-website.com/wp-content/themes/themeName/includes/lib/inc/redux/framework/FusionReduxCore/inc/extensions/import_export/import_export/field_import_export.css
there should not be any /var/lib/openshift/ in entire url
I need to get this fixed but I dont know anything about coding in Redux framework and have no idea how to change the path and point it to right path.
Upvotes: 4
Views: 1368
Reputation: 1210
Try dropping this into functions.php
function ReduxSymLinkURL(){
$url = "https://my-website.com/wp-content/themes/themeName/includes/lib/inc/redux/framework/FusionReduxCore/";
return $url;
}
add_filter( 'redux/_url', 'ReduxSymLinkURL', 10 );
Upvotes: 1
Reputation: 1165
Avada is a paid theme. When paid theme not working, developer should help you. It is purely related to that Theme, neither OpenShift nor core functions of WordPress. Newer WordPress supports different types of hosting and WordPress doc does have reference when URLs may be not like common traditional hosting.
I am giving an easy generic fix to load CSS at frontend. That plugin-symlink plugin offered by Sagar V is also generic. That is maximum we can do. You can try to find experienced Avada theme users.
Dependencies
Make sure that any dependency Wordpress plugin required by the theme is missing. Make sure that you have followed the guide of using Redux framework or that theme's official docs.
Examine how the links being generated
This is my 6 years old demo WordPress running on free Openshift with default WordPress theme without any issue. That theme's header file is finding html5.js
by :
<script src="<?php echo get_template_directory_uri(); ?>/js/html5.js" type="text/javascript"></script>
To find it, I went to Appearance > Editor > Theme Header (header.php)
from WordPress admin. Lajos Arpad was asking you that via comments. The correct way is to modify that code. He/She was saying How are your URLs being generated?
as we lack idea about which files, how generating the links. header.php
does for common themes but Redux framework themes may do it differently. Lajos Arpad already suggested you to search for field_import_export in the whole project via comments.
Generic fix
However we have no code. We need a generic fix. It is a temporary fix for the frontend. You need this at front end :
https://my-website.com/wp-content/wp-cntent/themes/themeName/includes/lib/inc/redux/framework/FusionReduxCore/inc/extensions/import_export/import_export/field_import_export.css
Make sure it is present, not 404. Install Header & Footer like plugin. Inject the CSS at frontend via that plugin :
<link rel="stylesheet" href="https://my-website.com/wp-content/wp-cntent/themes/themeName/includes/lib/inc/redux/framework/FusionReduxCore/inc/extensions/import_export/import_export/field_import_export.css" type="text/css">
Comment out the lines injecting CSS, Js in theme's header file or where it is being calling. Load and test. The fix will not suppress any warning but frontend will have loaded on frontend.
Upvotes: 1
Reputation: 12478
This is a known issue reported Here1, here2, here3, here4and so on.
This is not an issue with Redux.
This happens with theme
You have to contact the theme developer in order to fix this issue.
But there are solutions for to issues I posted above you can check it.
Anyway, I would like to post some fixes in the issues here
Quoting from WordPress
It's also important to note that PHP's FILE magic-constant resolves symlinks automatically, so if the wp-content or wp-content/plugins or even the individual plugin directory is symlinked, this function will not work corrrectly.
The theme link is symlinked. It is the issue.
A sample fix can be found here
Another one Quoting from @Liggitt
Wordpress provides hooks to filter the plugin path. I wrote a simple plugin that will adjust the plugin url to be correct, even when a symlinked folder is used.
ssh into your wordpress application, and run the following:
cd app-root/data/plugins/
git clone git://github.com/liggitt/wordpress-plugin-symlink.git
Log into your wordpress admin console, and activate the plugin-symlink plugin.
Upvotes: 1