Invalid style paths and Javascript in WordPress (Redux frame themes) when hosted in openshift

The theme options panel does not load correctly with certain themes in OpenShift. I am using a Wordpress theme which is built using the Redux framework. Everything works fine on localhost, but when I host the site in openshift the "theme options" don't work and the FireBug console shows the stylesheet and script paths are messed up with openshift.

The current (invalid) url for the example stylesheet looks like this:

https://my-website.com/wp-content/var/lib/openshift/5942968f 2d527198350000f2 / app -root / data / themes / th emeName / includes / lib / on / redo / framework / FusionReduxCore / on / extensions / import_e export / Import _Export / field_import_export. CSS

While it should be:

https://my-website.com/wp-content/themes/themeName/includes/ lib / inc / redux / framew ork / FusionReduxCore / inc / extensions / impor t_export / import_expo RT / field_import_expo rt.css

there should be no / var / lib / openshift / in the whole url

I need to get this fix, but I don't know anything about coding in a Redux environment and I don't know how to change the path and point it to the correct path.

+3


source to share


3 answers


This is a known issue. Here 1 here 2 here 3 here 4 etc.

This is not a problem with Redux.

It happens to the topic

You need to contact the theme developer to resolve this issue.

But there are solutions for the questions I posted above, you can check it out.

Anyway, I would like to post some fixes to problems here.

Quote from WordPress



It's also important to note that the PHP FILE magic constant automatically resolves symlinks, so if wp content or wp content / plugins or even a separate plugin directory is symbolically linked, this function will not work correctly.

The link to the topic is symbolic. This is problem.

The fix the fix can be found here

Another Quote from @Liggitt

Wordpress provides bindings to filter the plugin path. I wrote a simple plugin that will adjust the plugin url to be correct even if a symbolic folder is used.
ssh to your Wordpress application and do the following:

cd app-root/data/plugins/
git clone git://github.com/liggitt/wordpress-plugin-symlink.git

      

Log into the Wordpress admin console and activate the plugin-symlink plugin.

+1


source


Avada is a paid theme . When a paid theme doesn't work, a developer should help you. It is purely related to this Theme, neither OpenShift nor core WordPress functionality. The new WordPress supports different types of hosting, and there is a link in the WordPress doc where URLs might not look like regular traditional hosting .

I am giving a simple general fix for loading CSS in frontend. This plugin-symlink-plugin offered by Sagar V is generic as well. This is the maximum we can do. You can try to find experienced Avada theme users.

Dependencies

Make sure there is no dependent Wordpress plugin required by the theme. Make sure you have followed the tutorial on using the Redux framework or that the thematic white papers .

Explore how links are created

This is my 6 year old WordPress demo running free Openshift with the default WordPress theme without any problem . This theme header file is found 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 the WordPress admin. Lajos Arpad asked you to do this through comments. The correct way is to change this code. He / she spoke How are your URLs being generated?

because we lack an idea of ​​what files, how to generate links. header.php

does for general themes, but Redux framework themes can do it differently. Lajos Arpad has already suggested that you search for field_import_export throughout the project via comments.

General fix

However, we have no code. We need a general fix. This is a temporary fix for the interface. You need this at the front end:

https://my-website.com/wp-content/wp-cntent/themes/th‌​emeName/includes/lib‌​/inc/redux/framework‌​/FusionReduxCore/inc‌​/extensions/import_e‌​xport/import_export/‌​field_import_export.‌​css

      

Make sure it is present and not 404. Install Header and Footer like plugin . Inject CSS into the interface using this plugin:

<link rel="stylesheet" href="https://my-website.com/wp-content/wp-cntent/themes/th‌​emeName/includes/lib‌​/inc/redux/framework‌​/FusionReduxCore/inc‌​/extensions/import_e‌​xport/import_export/‌​field_import_export.‌​css"  type="text/css">

      

Comment out the lines where CSS, Js is inserted in the theme header file or wherever it calls. Loading and testing. The fix will not suppress any warnings, but the frontend will be loaded into the frontend.

+1


source


Try dropping this in functions.php

function ReduxSymLinkURL(){
  $url = "https://my-website.com/wp-content/themes/themeName/includes/‌​lib/inc/redux/framew‌​ork/FusionReduxCore/‌​";
  return $url;
}
add_filter( 'redux/_url', 'ReduxSymLinkURL', 10 );

      

+1


source







All Articles