Comments (27)
Okay here's my setting. I'M using roots theme and copied all the files to options inside the themefolder. Than in functions.php i have this code.
require_once locate_template('/lib/custom.php'); // Custom functions
if(!class_exists('ReduxFramework')){
require_once(dirname(FILE) . '/options/framework.php');
}
require_once(dirname(FILE).'/options/sample/sample-config.php');
Please note the call of custom.php here i have my options output and did it that way:
body {
background: url('<?php echo $roots['patterns']; ?>') <?php echo $roots['bgrepeat']; ?>;
font-family: <?php echo $roots['bodyfont']['family']; ?>;
font-size: <?php echo $roots['bodyfont']['size']; ?>px;
font-style: <?php echo $roots['bodyfont']['style']; ?>;
color: <?php echo $roots['bodyfont']['color']; ?>;
line-height: <?php echo $roots['bodyfont']['height']; ?>px;
}
Next step is to call the hook for printing out the inlinestyles and i do that inside the functions.php
add_action( 'wp_head', 'mytheme_dynamic_css' );
Thats all. You have to keep in mind to set the globals $your_var.
You can set your var inside the the sample_config.php and change this line to your needs:
// Set a custom option name. Don't forget to replace spaces with underscores!
$args['opt_name'] = 'roots';
from redux-framework.
@tonibecker Thanks... but i dont sure:
- why you have custom.php + sample-config in functions.php? you need only one no?
- I set the $args['opt_name'] = 'data'; - as you can see on my code example
dont understand why i stacked on this part... really dont understand.
Please who can - look on my code and find what i am doing wrong, i really want to use Redux on my new theme ...
from redux-framework.
I'm using roots. So i can split my functions into different files. So i can keep the structure clear.
Where do you call the options? I mean in wich file. In your first line you have to set global $data
from redux-framework.
Are you using version 3 or 2? If you are using version 2 than you should call it this way.
$options = get_option('data');
global $options
echo $options['identifier'];
from redux-framework.
Version 3
from redux-framework.
I never give up but it look like i cant figure so simple thing so...
from redux-framework.
I want to understand, if i download now Radux 3.0, and i install it , and dont change nothing... if i will use $twentytwelve22['somthing'] it will work?
Tried - nothing. still not get data.
from redux-framework.
can u grant access to your ftp? will have a look. Mail to me [email protected]
from redux-framework.
@tonibecker - thanks again :)
Its on localhost, but really - think it fresh site, blank site. just Redux that downloaded + some basic wordpress php files like header and footer.
What exact the steps to do?
from redux-framework.
whats inside your functions.php please paste your code. And where do you call the options from? Template and so on.
from redux-framework.
Fresh functions.php with
/**
* Set up Admin
*/
if(!class_exists('ReduxFramework')){
require_once(dirname(__FILE__) . '/admin/framework.php');
}
require_once(dirname(__FILE__).'/admin/options.php');
The options is on : themefolder/admin/options.php
Calling the $data['identi..'] from hedaer.php
from redux-framework.
please look inside your folder. there is a folder sample and inside this is sample_config.php
if(!class_exists('ReduxFramework')){
require_once(dirname(FILE) . '/your_redux_folder/framework.php');
}
require_once(dirname(FILE).'/your_redux_folder/sample/sample-config.php');
than in sample_config.php define the $args['opt_name'] = 'data';
go somewhere in a template file,m let's say page.php and add this global $data
and call your option
echo $data['your_identifier_from_sample_config.php'];
from redux-framework.
@tonibecker thanks again.
I use underscores_me theme, maybe it make trouble. tomorrow i will try on total fresh wordpress theme files without nothing, because your idea on last message make me sense and it still not working, so i guess i have code line that make here trouble.
from redux-framework.
For more details, we just updated the getting started page found here: http://reduxframework.com/docs/getting-started/
Re-open this if your issue was not resolved.
@tonibecker, thanks for helping @oshrib out!
from redux-framework.
Hi , thanks you all, and for the good doc. i cant explain, but it not working for me. i installed it on server, on Twenty Thirteen theme, and still - cant get the data.
Wordpress
Done, not need :)
FTP
Done, not need :)
Sorry for the "Radux" and not "Redux" :)
Dont worry, i going to delete this server account in 24 hours, its just developer environment for you to help me :)
Thanks for who will check it !
I install there Redux, without any change on opt_name, its as it comes
and on header.php i added on line 34:
on line 39: < img src="" />
and offcourse i installed Redux on functions.php first lines.
hope to understand what is stacking me here.
from redux-framework.
@oshrib Fixed. You were using the release of 3.0, and we've added the global stuff to the actual repo not in the official release yet.
Also you had the opt_name wrong. I have corrected it all.
There you go!
from redux-framework.
@dovy Dont know how to thank you.
I belive i will run from here with my cool theme, i will credit Redux and hope to be able to help in any way.
from redux-framework.
@oshrib Just an FYI, we'll be shifting redux to run as a plugin. I'd suggest you use it that way. Build your theme and I'll show you how to do so later.
;)
from redux-framework.
@dovy we'll still have the ability to use redux as embedded with only a few minor changes, right? Sort of like how SimpleOptions works?
from redux-framework.
@teamcrisis There will be an announcement about that shortly. The answer is yes, the ability will be there. If you want to will be another question. ;)
from redux-framework.
@dovy if we already here... how i can display image? < img src="" />
?
from redux-framework.
Huh? Anyone can skype me: info AT simplerain DOT com.
from redux-framework.
@oshrib < img src="" /> is how you'd call it.
The media object returns:
- id (media id)
- url
- width
- height
from redux-framework.
When I built the media object I personally needed more than a URL. SMOF replaces the site url with a shortcode, but they had a filter that ran through and really slowed things down.
I made it so you could recover details about the image without doing any DB call. You can with the media id get any size of the image (use the id for thumbnails), or you can know the ratio of the image (width/height) and if you find the URL doesn't match the site you pull the id.
I may (later) make it check for the ID and URL to see if they do indeed exist. That's for another day.
from redux-framework.
@oshrib You may want to see this: https://github.com/ReduxFramework/redux-converter
from redux-framework.
Hi, old issue, hope someone is reading :) Well.. I read everything you wrote, and it helped. most useful was @tonibecke. I wanted to add an image to the background. I can see the output, css is created, but instead of value all I can see in code is Array.. so, probably redux isn't saving to the db, or?
Any help much appreciated!
from redux-framework.
Before an older version of redux
'opt_name' => 'themeneeded'
from this
But Now Redux newer version
'opt_name' => $opt_name
please help to get output from this
from redux-framework.
Related Issues (20)
- Error in contact form HOT 1
- File Permission Issues We were unable to modify required files. Please ensure that /home/fitmaple/moccotheme.com/www/wp-content//uploads/ has the proper read-write permissions, or modify your wp-config.php file to contain your FTP login credentials as outlined here.. HOT 2
- Push Metabox field dynamically HOT 2
- Multilingual social media profiles HOT 1
- Check for object before assigning
- cannot click on pages HOT 1
- Can't change the home screen logo and colours of the theme HOT 1
- Unable to add variable products from woocommerce to my cart
- v4.4.10 - Undefined Variable $return in class-redux-filesystem.php
- Thecappa Theme - Animations can't be turned off HOT 1
- 4.4.10 Redux Upgrade - Fatal error HOT 1
- How to set default values for typography field with Redux::set_option? HOT 1
- change redux default values on child theme HOT 4
- Warning count display Nan on left side for color menu HOT 1
- Attribute not working with text field HOT 4
- WordPress Backend is buggy HOT 6
- Backend is buggy- No Field ID is set HOT 8
- Project Icon Category Type Not Change HOT 1
- Bug on switch or button_set fields while in tab and zero/false value HOT 2
- Bug in Dimension Field HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redux-framework.