__('A Section added by hook', 'asteria'), 'desc' => __('
This is a section created by adding a filter to the sections array. Can be used by child themes to add/remove sections from the options.
', 'asteria'), 'icon' => 'paper-clip', 'icon_class' => 'icon-large', // Leave this as a blank section, no options just some intro text set above. 'fields' => array() ); return $sections; } add_filter('redux-opts-sections-redux-sample', 'add_another_section'); /* * * Custom function for filtering the args array given by a theme, good for child themes to override or add to the args array. * */ function change_framework_args($args){ //$args['dev_mode'] = false; return $args; } //add_filter('redux-opts-args-redux-sample-file', 'change_framework_args'); /* * * Most of your editing will be done in this section. * * Here you can override default values, uncomment args and change their values. * No $args are required, but they can be over ridden if needed. * */ function setup_framework_options(){ $args = array(); // For use with a tab below $tabs = array(); ob_start(); $ct = wp_get_theme(); $theme_data = $ct; $item_name = $theme_data->get('Name'); $tags = $ct->Tags; $screenshot = $ct->get_screenshot(); $class = $screenshot ? 'has-screenshot' : ''; $customize_title = sprintf( __( 'Customize “%s”', 'asteria' ), $ct->display('Name') ); ?>display('Description'); ?>
parent() ) { printf( '' . __( 'This child theme requires its parent theme, %2$s.' ) . '
', __( 'http://codex.wordpress.org/Child_Themes', 'asteria' ), $ct->parent()->display( 'Name' ) ); } ?>This is the tab content, HTML is allowed.
', 'asteria') ); $args['help_tabs'][] = array( 'id' => 'redux-opts-2', 'title' => __('Theme Information 2', 'asteria'), 'content' => __('This is the tab content, HTML is allowed.
', 'asteria') ); // Set the help sidebar for the options page. $args['help_sidebar'] = __('This is the sidebar content, HTML is allowed.
', 'asteria'); // Add HTML before the form. if (!isset($args['global_variable']) || $args['global_variable'] !== false ) { if (!empty($args['global_variable'])) { $v = $args['global_variable']; } else { $v = str_replace("-", "_", $args['opt_name']); } $args['intro_text'] = __('Upgrade to Asteria PRO to Unlock all features and design your site anyway you want. For Documentation you can either click the Documentation tab or Download This PDF.
', 'asteria'); } else { $args['intro_text'] = __('This text is displayed above the options panel. It isn\'t required, but more info is always better! The intro_text field accepts all HTML.
', 'asteria'); } // Add content after the form. $args['footer_text'] = __('', 'asteria'); // Set footer/credit line. //$args['footer_credit'] = __('This text is displayed in the options panel footer across from the WordPress version (where it normally says \'Thank you for creating with WordPress\'). This field accepts all HTML.
', 'asteria'); $sections = array(); //Background Patterns Reader $sample_patterns_path = ReduxFramework::$_dir . '../sample/patterns/'; $sample_patterns_url = ReduxFramework::$_url . '../sample/patterns/'; $sample_patterns = array(); if ( is_dir( $sample_patterns_path ) ) : if ( $sample_patterns_dir = opendir( $sample_patterns_path ) ) : $sample_patterns = array(); while ( ( $sample_patterns_file = readdir( $sample_patterns_dir ) ) !== false ) { if( stristr( $sample_patterns_file, '.png' ) !== false || stristr( $sample_patterns_file, '.jpg' ) !== false ) { $name = explode(".", $sample_patterns_file); $name = str_replace('.'.end($name), '', $sample_patterns_file); $sample_patterns[] = array( 'alt'=>$name,'img' => $sample_patterns_url . $sample_patterns_file ); } } endif; endif; $sections[] = array( 'title' => __('Basic', 'asteria'), 'header' => '', 'desc' => '', 'icon_class' => 'icon-large', 'icon' => 'cogs', // 'submenu' => false, // Setting submenu to false on a given section will hide it from the WordPress sidebar menu! 'fields' => array( array( 'id'=>'site_width_id', 'type' => 'image_select', 'compiler'=>true, 'title' => __('Site Width', 'asteria'), 'subtitle' => __('Select between Fixed Width and Full Width', 'asteria'), 'options' => array( '1' => array('alt' => 'Fixed', 'img' => get_template_directory_uri().'/images/fixed.png'), '2' => array('alt' => 'Full Width', 'img' => get_template_directory_uri().'/images/fullwidth.png'), ), 'default' => '1' ), array( 'id'=>'head_type_id', 'type' => 'select', 'title' => __('Header Type', 'asteria'), 'subtitle' => '', 'desc' => __('Change how the header looks', 'asteria'), 'options' => array('head4' => 'Header Type 4'), 'default' => 'head4' ), array( 'id'=>'page_type_id', 'type' => 'select', 'title' => __('Page Header Type', 'asteria'), 'subtitle' => '', 'desc' => __('Change how the Page Title Looks', 'asteria'), 'options' => array('1' => 'Big Page header','2' => 'Normal Page Header'), 'default' => '1' ), array( 'id'=>'ajax_id', 'type' => 'switch', 'title' => __('Ajax Pagination', 'asteria'), 'subtitle'=> __('Ajax pagination(Go to next page without reloading the page', 'asteria'), "default" => 1, ), array( 'id'=>'totop_id', 'type' => 'switch', 'title' => __('To Top Button', 'asteria'), 'subtitle'=> __('Turn On/Off "To Top Button"(The button that appears on bottom right when you scroll down to pages.', 'asteria'), "default" => 1, ), array( 'id'=>'footer_text_id', 'type' => 'editor', 'title' => __('Footer Copyright Text', 'asteria'), 'default' => '', ), ), ); $sections[] = array( 'type' => 'divide', ); $sections[] = array( 'icon' => 'home-alt', 'icon_class' => 'icon-large', 'title' => __('Front Page ', 'asteria'), 'fields' => array( array( 'id'=>'block1_text_id', 'type' => 'text', 'title' => __('Block 1 Title', 'asteria'), 'default' => 'Lorem Ipsum' ), array( 'id'=>'block1_icon', 'type' => 'select', 'title' => __('Block 1 Icon', 'asteria'), 'data' => 'elusive',//Must provide key => value pairs for select options 'default' => 'fa-camera' ), array( 'id'=>'block1_link_id', 'type' => 'text', 'title' => __('Block 1 Link', 'asteria') ), array( 'id'=>'block1_textarea_id', 'type' => 'editor', 'title' => __('Block 1 Content', 'asteria'), 'default' => 'Lorem ipsum dolor sit amet, consectetur dol adipiscing elit. Nam nec rhoncus risus. In ultrices lacinia ipsum, posuere faucibus velit bibe.', ), array( 'id'=>'block2_text_id', 'type' => 'text', 'title' => __('Block 2 Title', 'asteria'), 'default' => 'Lorem Ipsum' ), array( 'id'=>'block2_icon', 'type' => 'select', 'title' => __('Block 2 Icon', 'asteria'), 'data' => 'elusive',//Must provide key => value pairs for select options 'default' => 'fa-rocket' ), array( 'id'=>'block2_link_id', 'type' => 'text', 'title' => __('Block 2 Link', 'asteria') ), array( 'id'=>'block2_textarea_id', 'type' => 'editor', 'title' => __('Block 2 Content', 'asteria'), 'default' => 'Lorem ipsum dolor sit amet, consectetur dol adipiscing elit. Nam nec rhoncus risus. In ultrices lacinia ipsum, posuere faucibus velit bibe.', ), array( 'id'=>'block3_text_id', 'type' => 'text', 'title' => __('Block 3 Title', 'asteria'), 'default' => 'Lorem Ipsum' ), array( 'id'=>'block3_icon', 'type' => 'select', 'title' => __('Block 3 Icon', 'asteria'), 'data' => 'elusive',//Must provide key => value pairs for select options 'default' => 'fa-signal' ), array( 'id'=>'block3_link_id', 'type' => 'text', 'title' => __('Block 3 Link', 'asteria') ), array( 'id'=>'block3_textarea_id', 'type' => 'editor', 'title' => __('Block 3 Content', 'asteria'), 'default' => 'Lorem ipsum dolor sit amet, consectetur dol adipiscing elit. Nam nec rhoncus risus. In ultrices lacinia ipsum, posuere faucibus velit bibe.', ), array( 'id'=>'block4_text_id', 'type' => 'text', 'title' => __('Block 4 Title', 'asteria'), 'default' => 'Lorem Ipsum' ), array( 'id'=>'block4_icon', 'type' => 'select', 'title' => __('Block 4 Icon', 'asteria'), 'data' => 'elusive', 'default' => 'fa-cogs' ), array( 'id'=>'block4_link_id', 'type' => 'text', 'title' => __('Block 4 Link', 'asteria') ), array( 'id'=>'block4_textarea_id', 'type' => 'editor', 'title' => __('Block 4 Content', 'asteria'), 'default' => 'Lorem ipsum dolor sit amet, consectetur dol adipiscing elit. Nam nec rhoncus risus. In ultrices lacinia ipsum, posuere faucibus velit bibe.', ), array( 'id'=>'welcm_textarea_id', 'type' => 'editor', 'title' => __('Welcome Text', 'asteria'), 'default' => 'The Very recent work for our clients
', ), array( 'id'=>'front_layout_id', 'type' => 'image_select', 'compiler'=>true, 'title' => __('Posts layout', 'asteria'), 'options' => array( '1' => array('alt' => 'Layout 1', 'img' => get_template_directory_uri().'/images/layout1.png'), ), 'default' => '1' ), array( 'id'=>'enable_cat', 'type' => 'switch', 'title' => __('Display posts from selected Categories', 'asteria'), "default" => 0, ), array( 'id'=>'posts_cat_id', 'type' => 'select', 'data' => 'categories', 'multi' => true, 'title' => __('Category Names', 'asteria'), ), array( 'id'=>'n_posts_field_id', 'type' => 'text', 'title' => __('Number of Posts ', 'asteria'), 'default' => '9', ), array( 'id'=>'map-info', 'type' => 'info', 'desc' => __("This feature is only available in Asteria PRO", "asteria"), ), array( 'id'=>'callaction-info', 'type' => 'info', 'desc' => __("This feature is only available in Asteria PRO", "asteria"), ), array( 'id'=>'widget-info', 'type' => 'info', 'desc' => __("This feature is only available in Asteria PRO", "asteria"), ), array( 'id' => 'home_sort_id', 'type' => 'sortable', 'mode' => 'checkbox', // checkbox or text 'title' => __('Frontpage Elements position', 'asteria'), 'desc' => __('Drag and Drop each element to reorder their position.', 'asteria'), 'options' => array( 'blocks' => 'Blocks', 'welcome-text' => 'Welcome Text', 'posts' => 'Frontpage Posts' ), 'default' => array( 'blocks' => 'Blocks', 'welcome-text' => 'Welcome Text', 'posts' => 'Frontpage Posts' ) ), ) ); $sections[] = array( 'icon' => 'website', 'icon_class' => 'icon-large', 'title' => __('Slider', 'asteria'), 'fields' => array( array( 'id'=>'slider_type_id', 'type' => 'select', 'title' => __('Slider Type', 'asteria'), 'options' => array('nivo'=>'Nivo Slider','noslider'=>'Disable Slider'), 'default' => 'nivo', ), array( 'id'=>'n_slide_time_id', 'type' => 'text', 'title' => __('Pause Time Between Each Slide ', 'asteria'), 'default' => '4000', ), array( 'id'=>'slide_height', 'type' => 'text', 'title' => __('Slider Height ', 'asteria'), 'default' => '500px', ), array( 'id'=>'slidefont_size_id', 'type' => 'text', 'title' => __('Slide Font Size', 'asteria'), 'default' => '60px' ), array( 'id'=>'slides', 'type' => 'slides' ), ) ); $sections[] = array( 'icon' => 'tint', 'icon_class' => 'icon-large', 'title' => __('Style', 'asteria'), 'fields' => array( //Elements Color array( 'id'=>'sec_color_id', 'type' => 'color', 'title' => __('Secondary Element background Color', 'asteria'), 'default' => '#2dcb73', 'transparent' => false, 'validate' => 'color', ), //Text Colors array( 'id'=>'primtxt_color_id', 'type' => 'color', 'title' => __('Site wide Text Color', 'asteria'), 'default' => '#888888', 'transparent' => false, 'validate' => 'color', ), array( 'id'=>'sectxt_color_id', 'type' => 'color', 'title' => __('Text Color on secondary elements', 'asteria'), 'default' => '#FFFFFF', 'transparent' => false, 'validate' => 'color', ), array( 'id'=>'leavreplytxt_color_id', 'type' => 'color', 'title' => __('"Leave a Reply" Text Color', 'asteria'), 'default' => '#333333', 'transparent' => false, 'validate' => 'color', ), //// array( 'id'=>'style_dvd', 'type' => 'divide' ), array( 'id'=>'rounded_id', 'type' => 'switch', 'title' => __('Rounded Corners', 'asteria'), "default" => 0, ), array( 'id'=>'shadow_id', 'type' => 'switch', 'title' => __('Drop Shadow', 'asteria'), "default" => 0, ), array( 'id'=>'style-info', 'type' => 'info', 'desc' => __("More Styling Options are only available in Asteria PRO", "asteria"), ), ) ); $sections[] = array( 'icon' => 'text-height', 'icon_class' => 'icon-large', 'title' => __('Typography Settings', 'asteria'), 'fields' => array( array( 'id'=>'logo_font_id', 'type' => 'typography', 'title' => __('Logo Style', 'asteria'), 'subtitle' => __('Specify the body font properties.', 'asteria'), 'google'=>true, 'font-backup'=>false, 'line-height'=>false, 'default' => array( 'color'=>'#ffffff', 'font-size'=>'50px', 'font-family'=>'Cinzel Decorative', 'font-weight'=>'Normal', ), ), array( 'id'=>'typo-info', 'type' => 'info', 'desc' => __("More Typography Options are only available in Asteria PRO", "asteria"), ), ) ); $sections[] = array( 'icon' => 'twitter', 'icon_class' => 'icon-large', 'title' => __('Social', 'asteria'), 'fields' => array( array( 'id'=>'social_single_id', 'type' => 'switch', 'title' => __('Social Share Icons under Posts ', 'asteria'), "default" => 1, ), array( 'id'=>'social_color_id', 'type' => 'color', 'title' => __('Social Share Icons Color ', 'asteria'), 'default' => '#CCCCCC', 'transparent' => false, 'validate' => 'color', ), array( 'id'=>'social_dvd', 'type' => 'divide' ), array( 'id'=>'facebook_field_id', 'type' => 'text', 'title' => __('Facebook URL ','asteria'), 'validate' => 'url', ), array( 'id'=>'twitter_field_id', 'type' => 'text', 'title' => __('Twitter URL ','asteria'), 'validate' => 'url', ), array( 'id'=>'gplus_field_id', 'type' => 'text', 'title' => __('Google Plus URL ','asteria'), 'validate' => 'url', ), array( 'id'=>'youtube_field_id', 'type' => 'text', 'title' => __('Youtube URL ','asteria'), 'validate' => 'url', ), array( 'id'=>'flickr_field_id', 'type' => 'text', 'title' => __('Flickr URL ','asteria'), 'validate' => 'url', ), array( 'id'=>'linkedin_field_id', 'type' => 'text', 'title' => __('Linkedin URL ','asteria'), 'validate' => 'url', ), array( 'id'=>'pinterest_field_id', 'type' => 'text', 'title' => __('Pinterest URL ','asteria'), 'validate' => 'url', ), array( 'id'=>'tumblr_field_id', 'type' => 'text', 'title' => __('Tumblr URL ','asteria'), 'validate' => 'url', ), array( 'id'=>'instagram_field_id', 'type' => 'text', 'title' => __('Instagram URL ','asteria'), 'validate' => 'url', ), array( 'id'=>'rss_field_id', 'type' => 'text', 'title' => __('RSS URL ','asteria'), 'validate' => 'url', ), ) ); $sections[] = array( 'icon' => 'tasks', 'icon_class' => 'icon-large', 'title' => __('Miscellaneous Settings', 'asteria'), 'fields' => array( array( 'id'=>'cat_layout_id', 'type' => 'image_select', 'compiler'=>true, 'title' => __('Category, Archive Page posts layout', 'asteria'), 'options' => array( '1' => array('alt' => 'Layout 1', 'img' => get_template_directory_uri().'/images/layout1.png') ), 'default' => '1' ), array( 'id'=>'post_info_id', 'type' => 'switch', 'title' => __('Show Post Info - Date, Author Name, Categories etc..', 'asteria'), "default" => 1, ), array( 'id'=>'post_nextprev_id', 'type' => 'switch', 'title' => __('Show Next and Previous Posts', 'asteria'), "default" => 1, ), array( 'id'=>'post_comments_id', 'type' => 'switch', 'title' => __('Show Comments', 'asteria'), "default" => 1, ), array( 'id'=>'post_lightbox_id', 'type' => 'switch', 'title' => __('Lightbox Feature', 'asteria'), "default" => 1, ), array( 'id'=>'post_gallery_id', 'type' => 'switch', 'title' => __('Beautify My Galleries', 'asteria'), "default" => 1, ), array( 'id'=>'blog_cat_id', 'type' => 'select', 'data' => 'categories', 'title' => __('Display Blog Posts from a selected Category', 'asteria'), 'desc' => __('If you have setup a Blog page with Blog Page Template, choose a category to get the posts from', 'asteria'), ), ) ); $sections[] = array( 'icon' => 'phone', 'icon_class' => 'icon-large', 'title' => __('Mobile Layout', 'asteria'), 'desc' => __('Checking each of these below option will only hide these elements from the Mobile layout.', 'asteria'), 'fields' => array( array( 'id'=>'hide_mob_slide', 'type' => 'checkbox', 'title' => __('Hide Slider', 'asteria'), 'desc' => '', 'default' => '0' ), array( 'id'=>'hide_mob_blocks', 'type' => 'checkbox', 'title' => __('Hide Front Page Blocks', 'asteria'), 'desc' => '', 'default' => '0' ), array( 'id'=>'hide_mob_welcm', 'type' => 'checkbox', 'title' => __('Hide Front Page Welcome Text', 'asteria'), 'desc' => '', 'default' => '0' ), array( 'id'=>'hide_mob_frontposts', 'type' => 'checkbox', 'title' => __('Hide Front Page Posts', 'asteria'), 'desc' => '', 'default' => '0' ), array( 'id'=>'hide_mob_footwdgt', 'type' => 'checkbox', 'title' => __('Hide Footer Widgets', 'asteria'), 'desc' => '', 'default' => '0' ), array( 'id'=>'hide_mob_rightsdbr', 'type' => 'checkbox', 'title' => __('Hide Right Sidebar', 'asteria'), 'desc' => '', 'default' => '0' ), ) ); $sections[] = array( 'icon' => 'css', 'icon_class' => 'icon-large', 'title' => __('Custom CSS', 'asteria'), 'desc' => __('Write your custom css here', 'asteria'), 'fields' => array( array( 'id'=>'custom-css', 'type' => 'textarea', 'validate' => 'css', ), ) ); $sections[] = array( 'icon' => 'wrench-alt', 'icon_class' => 'icon-large', 'title' => __('Maintenance Mode', 'asteria'), 'fields' => array( array( 'id'=>'offline_id', 'type' => 'switch', 'title' => __('Maintenance Mode', 'asteria'), "default" => 0, ), array( 'id'=>'offline_date_id', 'type' => 'date', 'title' => __('Date ', 'asteria'), 'subtitle' => __('Site will be online on', 'asteria') ), array( 'id'=>'offline_time_id', 'type' => 'text', 'title' => '' ), array( 'id'=>'offline_text_id', 'type' => 'text', 'title' => __('Title ', 'asteria'), 'default' => 'Maintenance Mode' ), array( 'id'=>'offline_msg_id', 'type' => 'editor', 'title' => __('Message ', 'asteria'), 'default' => 'We are currently undergoing maintenance. Please try back after', ), ) ); $sections[] = array( 'type' => 'divide', ); $sections[] = array( 'icon' => 'exclamation-sign', 'icon_class' => 'icon-large', 'title' => __('About The Theme', 'asteria'), 'fields' => array( array( 'id'=>'about_id', 'type' => 'info', 'required' => array('18','equals',array('1','2')), 'raw_html'=>true, 'desc' => $about, ), ) ); $sections[] = array( 'icon' => 'upload', 'icon_class' => 'icon-large', 'title' => __('Upgrade to PRO', 'asteria'), 'fields' => array( array( 'id'=>'upgrade_id', 'type' => 'info', 'required' => array('18','equals',array('1','2')), 'raw_html'=>true, 'desc' => $upgrade, ), ) ); $sections[] = array( 'icon' => 'book', 'icon_class' => 'icon-large', 'title' => __('Documentation', 'asteria'), 'fields' => array( array( 'id'=>'docu_id', 'type' => 'info', 'required' => array('18','equals',array('1','2')), 'raw_html'=>true, 'desc' => $documentation, ), ) ); global $ReduxFramework; $ReduxFramework = new ReduxFramework($sections, $args, $tabs); } add_action('init', 'setup_framework_options', 0); /* * * Custom function for the callback referenced above * */ function my_custom_field($field, $value) { print_r($field); print_r($value); } /* * * Custom function for the callback validation referenced above * */ function validate_callback_function($field, $value, $existing_value) { $error = false; $value = 'just testing'; /* do your validation if(something) { $value = $value; } elseif(somthing else) { $error = true; $value = $existing_value; $field['msg'] = 'your custom error message'; } */ $return['value'] = $value; if($error == true) { $return['error'] = $field; } return $return; } /* This is a test function that will let you see when the compiler hook occurs. It only runs if a field set with compiler=>true is changed. */ function testCompiler() { //echo "Compiler hook!"; } add_action('redux-compiler-redux-sample-file', 'testCompiler'); /** Use this function to hide the activation notice telling users about a sample panel. **/ function removeReduxAdminNotice() { delete_option('REDUX_FRAMEWORK_PLUGIN_ACTIVATED_NOTICES'); } add_action('redux_framework_plugin_admin_notice', 'removeReduxAdminNotice');