reduxframework / redux-framework

Redux is a simple, truly extensible options framework for WordPress themes and plugins!
http://redux.io
Other
1.73k stars 582 forks source link

Global $redux_demo doesn't work everywhere #888

Closed Kamel38 closed 10 years ago

Kamel38 commented 10 years ago

The global work on main pages like "header.php" "footer.php" ... but when I create a new page : contact.php for exemple, it doesn't work. I can not retrieve the contents of the variable. Can somebody help me please ?

kprovance commented 10 years ago

Are you adding global $redux_demo in the code before attempting to use it? If yes, then I we need the specific version of Redux you are using (please do not say 'latest', the actual four digit version from the bottom of you options panel is required) and a snippet of the code you are attempting to use.

Kamel38 commented 10 years ago

I'm using Redux v3.1.8.3. This is one of the pages for which the global doesn't work (i'ts a contact page) : http://codeshare.io/eS1KP

dovy commented 10 years ago

Try doing $GLOBALS['YOUR_OPT_NAME']

kprovance commented 10 years ago

And also, upgrade to the latest version v.3.1.8.12

Kamel38 commented 10 years ago

Dov --> 'redux_demo' is my option name. I kept the default parameters.

kprovance --> If I upgrade to the latest version, should I "re-code" everything ?

dovy commented 10 years ago

@Kamel38 I am saying do the following:

print_r($GLOBALS['redux_demo']);

And just download from this repo and you replace the redux-framework plugin with the content font here. ;)

Kamel38 commented 10 years ago

print_r($GLOBALS['redux_demo']); do nothing :/ In others than mains pages, I can't call the variable :(

dovy commented 10 years ago

That's odd. Are you sure you have the right opt_name then and have Redux running?

Kamel38 commented 10 years ago

Yes I am, It works in aaalll others pages. But when I want to create a New page : impossible

Kamel38 commented 10 years ago

Could somebody help me with TeamViewer ? Thus, he will see all my files and I hope, should find the probleme ^_^'

kprovance commented 10 years ago

Did you upgrade to the latest repo? You won't have to recode anything.

kprovance commented 10 years ago

Are you using Redux as a plugin or embedded? if you are embedding, are you embedding within the parent theme, or the child theme? Is you config set in the parent theme or the child theme? Have you tried using file_exists on your config path to see if they exist, or echo back the path to see if it's accurate? Let's start with answers to these basic things and work from there. Also, commenting on other threads you are having the same problem isn't helpful. Instead, you could provide us with the necessary information to work toward a resolution. Thanks!

kprovance commented 10 years ago

Okay, you're up. Zip up your theme and send it over. Please don't leave any files out, it's got to be the entire thing so I can trace the issue.

kevin@reduxframework.com

Use: http://wetransfer.com

Kamel38 commented 10 years ago

Sent

kprovance commented 10 years ago

I took a look at line 6 on your contact.php, where the body font is set via a style selector (hint: use CSS, save yourself a lot of misery). I loaded it up and it returned Roboto, as specified in your options panel. But I have to question your method of <?php global $redux_demo; ?> in a file called redux.php and using an include statement to load it at the top of the page? That's far from accepted practices. Why not just stick global $redux_demo; at the top of the page and be done with it?

Either way, it did not fail for me. See for yourself:

roboto

If the code in custom-style.php, it's because it's completely malformed and will never work properly until it's fixed.

I'm not sure what to tell you. Our code is working as intended. The problem lies somewhere on your side, outside of Redux. Maybe @Dovy has an idea or something I've overlooked, but after running your theme code on my set up successfully, I think we've fallen outside the scope of free support here, since it's not Redux.

Kamel38 commented 10 years ago

For the redux.php, forget it : I tried different way when I saw the global doesn't work. :D The theme I build is not finished yet, so there is still a lot of errors that I'll correct later. For now, I just try to have something of fonctional. The problem I was talking about is not for the font-family on the file "contact.php" but in the file "contact-send.php" for the receiver of the mail. Did you see/check it ? Sorry if I misspoke or if I didn't understood. I'm French student, I don't speak English very well : I juste do with what I've learned at school :)

kprovance commented 10 years ago

Well, the plot thickens. First, you said but when I create a new page : contact.php for exemple, it doesn't work, which isn't exactly true, since it does work. Next, the page you finally told me about, contact-send.php is being passed through a javascript call to send a contact form. That would have been useful information to have, especially since we're being led to believe that Redux isn't working on any newly created page. I tried to run it once or twice to see what was going on, but I keep getting code 500 errors from other functions involving images and jQuery.

I'm sorry, but once again, this isn't an issue with Redux itself, since it does work. It's an implementation issue, and we don't have the resources to debug everyones code. I can tell you that you don't need to use javascript to submit a contact form. All you really need to do is use form tags and post from there, where we know Redux works. A Google search will turn up unlimited examples.

Good luck! :)

Kamel38 commented 10 years ago

Oh, so if I can't call redux variable , it's because of javascript ? In this case, sorry : I didn't know it. I thought the variable doesn't work, I didn't suspect the javascrit. Now, I know that if I can't call $redux_demo in a page, it's because of something in tis page. Thank you for your time, I'll try to resolve the problem.