Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /* link - http://aquagraphite.com/2011/09/slightly-modded-options-framework/
- Documentation - http://aquagraphite.com/2011/11/smof-documentation/
- Github - https://github.com/syamilmj/Options-Framework */
- 1. Download
- 2. Go to Options-Framework-master > admin folder copy it
- 3. Paste admin folder in your theme file
- /* ActiveSMOF - Slightly Modded Options Framework */
- 4.
- require_once ('admin/index.php');
- 5. /* edit option - */
- Go to admin > functions folder > functions.options.php then edit it
- like this -
- $of_options[] = array( "name" => "Media Uploader",
- "desc" => "Upload images using native media uploader.",
- "id" => "media_upload",
- "std" => "",
- "type" => "media");
- 1. name – This is the title that will be displayed on the options panel.
- 2. desc – Description for the option
- 3. id – A unique id for your option.
- 4. std – A standard value for the option.
- 5. type – The type of option
- /* some option type - */
- "info"
- "upload"
- "media"
- "sliderui"
- "spinner"
- "switch"
- "text"
- "slider"
- "typography"
- "tiles"
- "images"
- "textarea"
- "select"
- "tiles"
- "checkbox"
- "radio"
- "select_google_font"
- "checkbox"
- /* Slightly Modded Options Framework use or call */
- 6.
- /* type one */
- 1. single data - <?php global $data; //fetch options stored in $data
- echo $data['your_option_id']; ?> //get $data['id'] then echo the value
- /* type two */
- 2. Conditional Data - <?php global $data; ?>
- <?php if($data['your_option_id']): ?>
- <?php echo $data['your_option_id']; ?>
- <?php endif; ?>
- /* type three */
- 3. conditional data with default data -
- <?php global $data; ?>
- <?php if($data['your_option_id']): ?>
- <?php echo $data['your_option_id']; ?>
- <?php else: ?>
- My Default Data
- <?php endif; ?>
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement