72 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
jezh says

Hi,

I’m trying to use Redux framework with my theme but for the life of me I can’t seem to make my custom option panel appear in the wp dashboard when installing Redux as a plugin.

Please bear with me as I’m going nuts here. These are the steps I’m taking to make my own config file appear in a theme when the user installs the plugin.

As an example I’m trying to make the option panel in the twentyfourteen theme just in case there is something wrong with mine.

- I copy the sample folder with the sample-config.php from the Redux plugin directory, and paste it in the root folder of the twentyfourteen theme. - In the functions.php I include the sample config by adding

require_once(dirname(FILE).'/sample/sample-config.php');
- I change the value of the ‘opt_name’ variable to something unique. - I deactivate the demo mode in the plugins area of WordPress

aaand…. Nothing happens, no option panel.

I’m using
Redux Plugin version 3.1.9
WP version 3.8.2

Is there a step I’m missing, I’ve been pulling my hair for two days now searching the Redux wiki and documentation but this is all I could find.

Please, any help would be greatly appreciated.

Ivan

125 posts
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Romania
  • Has been part of the Envato Community for over 2 years
bucur says
My code is in functions.php
// load the theme's framework if ( !class_exists( 'ReduxFramework' ) && file_exists( dirname(__FILE__) . '/framework/ReduxCore/framework.php' ) ) { require_once( dirname(__FILE__) . '/framework/ReduxCore/framework.php' ); } // load the theme's options if ( !isset( $redux_owd ) && file_exists( dirname(__FILE__) . '/framework/sample/options.php' ) ) { require_once( dirname(__FILE__) . '/framework/sample/options.php' ); }
creat in theme folder name framework and upload Redux folder there.
I saw you asked and we Issues to put there the same answer for others.
125 posts
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Romania
  • Has been part of the Envato Community for over 2 years
bucur says

Personally I have another issue with redux …
http://themeforest.net/forums/thread/redux-issue-logo/128817

72 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
jezh says

Hey bucur, thanks for replying, That code works for me too but that’s when embedding the framework into a theme.

I wan’t to know how to display custom options when the user installs the redux as a plugin. Any thoughts?

And also, what would be the best practice for the Themeforest theme – to use Redux as a plugin or to embed it into a theme?

125 posts
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Located in Romania
  • Has been part of the Envato Community for over 2 years
bucur says

Most theme we have directly incorporated into the theme.

72 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
jezh says

I can get the option panel to appear with the above code bucur posted, but as soon as I activate the plugin I get this error:

Fatal error: Call to undefined method Redux_Helpers::isTheme() in sample-config.php on line 24

Haven’t changed anything in the sample-config file but the opt_name value to something else…

Anyone have any idea what I’m doing wrong?

77 posts
  • Has referred 1+ members
  • Has collected 50+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 7 years
+1 more
SimpleRain says

Ahh, you’re loading within a plugin. Be sure to run your plugin code AFTER the plugins_loaded hook. You’re plugin basically is sooner in the alphabet than Redux, and thus it is not loaded by the time you try to run your code. Just wrap your init() functions inside a plugins_loaded hook and it will all work. :)

P.S. Lead dev of Redux here. ;)

72 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
jezh says

Hi Simple Rain, thanks for dropping in :)

As a matter of fact I’m not loading Redux from within a plugin, but from within a theme.

The thing is that when I embed the framework following these instructions on your wiki it works all good and well.

But when I install and activate the plugin (with the embed code still in my functions.php) I get the aforementioned Fatal Error.

On the other hand, when I just install the plugin and don’t use the embed code, but these instructions here I can’t get my custom panel to appear. The demo works fine.

I know there’s something I’m overlooking, but for the life of me I can’t figure out what XD

77 posts
  • Has referred 1+ members
  • Has collected 50+ items on Envato Market
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 7 years
+1 more
SimpleRain says

Ahh. That’s because you’re using the wordpress.org plugin and we haven’t updated to 3.2. That helper function was a new addition, but we keep making improvements to the code before the release. Hence, the error.

I’d suggest for Dev work on the code from the repo. We should have a release by next week alleviating all these concerns. ;)

72 posts
  • Has been part of the Envato Community for over 4 years
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
jezh says

I really thought I was losing my mind :confused:

Yes, the plugin is from the wordpress.org. I was testing the scenario where I would ship my theme with the embedded code and the user updates or installs the plugin on his own.

But still, I don’t know why I couldn’t make the plugin (without the embed code) display my custom option panel. I could only get the demo panel to appear when activated.

Is adding

require_once(dirname(FILE).'/sample/sample-config.php');

to the functions.php all I have to do make my option panel appear in the dashboard. Is that also related to the plugin version?

The repo code works beautifully, and I really enjoy playing around with all the options.

Thanks for the answering me in such short notice.

by
by
by
by
by
by