cat_ID] = $category->cat_name; } $imagepath = get_template_directory_uri() . '/includes/options-framework/images/'; $logofile = get_template_directory_uri() . '/images/logo.png'; $sliderimage = get_template_directory_uri() . '/images/default-slide.png'; $options = array(); /*------------------------------------- Display --------------------------------------*/ $options[] = array('name' => __('Display', 'asr'), 'type' => 'heading'); $options[] = array( 'name' => __('Favicon', 'asr'), 'desc' => __('Choose an icon or image to be used as a favicon. You can either upload a file or enter a url.', 'asr'), 'id' => 'favicon', 'type' => 'upload'); $options[] = array( 'name' => __('Top Bar', 'asr'), 'desc' => __('Show the Top Bar.', 'asr'), 'id' => 'top_bar_enable', 'type' => 'checkbox', 'std' => '1'); $options[] = array( 'desc' => __('Note: the Top Menu only supports top level menu items. It will not show any sub-menus.', 'asr'), 'id' => 'top_bar_elements', 'type' => 'multicheck', 'std' => array( 'title' => '1', 'description' => '1', 'top_menu' => '0'), 'options' => array( 'title' => __('Site Title', 'asr'), 'description' => __('Site Description', 'asr'), 'top_menu' => __('Top Menu', 'asr')) ); $options[] = array( 'name' => __('Header', 'asr'), 'desc' => __('Show the Header.', 'asr'), 'id' => 'header_enable', 'type' => 'checkbox', 'std' => '1'); $options[] = array( 'desc' => __('Set the minimum Header Height that is to be used when no Header Logo is present.', 'asr'), 'id' => 'header_height', 'type' => 'text', 'std' => '140', 'class' => 'mini px-after'); $options[] = array( 'name' => __('Header Logo', 'asr'), 'desc' => __('This option is intended for adding or removing your website\'s logo. To change your header\'s background image, check here: Background Image', 'asr'), 'id' => 'header_logo', 'type' => 'upload', 'std' => $logofile); $options[] = array( 'name' => __('Main Menu', 'asr'), 'desc' => __('Show the Main Menu.', 'asr'), 'id' => 'main_menu_enable', 'type' => 'checkbox', 'std' => '1'); $options[] = array( 'desc' => __('Select responsive Main Menu style for small screens.', 'asr'), 'id' => 'main_menu_style', 'type' => 'radio', 'std' => 'stack', 'options' => array( 'stack' => 'Stacked', 'drop' => 'Drop-down') ); $options[] = array( 'name' => __('Footer Text', 'asr'), 'id' => 'bottom_bar_text', 'type' => 'textarea', 'std' => get_bloginfo('name') . ' © ' . date('Y'), 'class' => 'code'); /*------------------------------------- Layout --------------------------------------*/ $options[] = array('name' => __('Layout', 'asr'), 'type' => 'heading'); $options[] = array( 'name' => __('Main Layout', 'asr'), 'desc' => __('Select default content and sidebar layout.', 'asr'), 'id' => 'column_layout', 'type' => 'images', 'std' => 'col-cs', 'options' => array( 'col-cs' => $imagepath . 'col-cs.png', 'col-c' => $imagepath . 'col-c.png', 'col-sc' => $imagepath . 'col-sc.png', 'col-css' => $imagepath . 'col-css.png', 'col-scs' => $imagepath . 'col-scs.png', 'col-ssc' => $imagepath . 'col-ssc.png') ); $options[] = array( 'name' => __('Container Width', 'asr'), 'desc' => __('Use the slider to set the width of the container.', 'asr'), 'id' => 'width_container', 'type' => 'slider_ui_width_container', 'std' => '960'); $options[] = array( 'name' => __('Two Column Widths', 'asr'), 'desc' => __('Set the width percentage for the content area and a sidebar. These values apply wherever a two-column layout is being used.', 'asr'), 'id' => 'width_two_column', 'type' => 'slider_ui_width_2col', 'std' => '65'); $options[] = array( 'name' => __('Three Column Widths', 'asr'), 'desc' => __('Set the width percentage for the content area and two sidebars. These values apply wherever a three-column layout is being used.', 'asr'), 'id' => 'width_three_column', 'type' => 'slider_ui_width_3col', 'std' => '25-75'); /*------------------------------------- Blog --------------------------------------*/ $options[] = array('name' => __('Blog View', 'asr'), 'type' => 'heading'); $options[] = array( 'name' => __('Article Display', 'asr'), 'desc' => __('Select whether to show excerpts or full content.', 'asr'), 'id' => 'blog_display', 'type' => 'radio', 'std' => 'excerpt', 'options' => array( 'excerpt' => 'Excerpt', 'full' => 'Full') ); $options[] = array( 'name' => __('Article Elements', 'asr'), 'desc' => __('Select elements to display when posts are displayed on blog view. Note: Thumbnail uses the featured image that is set on each post.', 'asr'), 'id' => 'blog_elements', 'type' => 'multicheck', 'std' => array( 'thumbnail' => '1', 'author' => '1', 'published' => '1', 'categories' => '1', 'comment_info' => '1', 'continue_btn' => '1', 'updated' => '0', 'tags' => '0'), 'options' => array( 'thumbnail' => __('Thumbnail (Only on Excerpts)', 'asr'), 'author' => __('Byline Author', 'asr'), 'published' => __('Byline Date Published', 'asr'), 'categories' => __('Byline Categories', 'asr'), 'comment_info' => __('Byline Comment Info', 'asr'), 'continue_btn' => __('Read Post Button (Only on Excerpts)', 'asr'), 'updated' => __('Date Updated', 'asr'), 'tags' => __('Tags', 'asr')) ); $options[] = array( 'name' => __('Thumbnail Size', 'asr'), 'desc' => __('Note: If you choose the 200 × 120 size you may need to regenerate thumbnails to get the exact image size. Use "Regenerate Thumbnail" plugins.', 'asr'), 'id' => 'excerpt_thumbnail', 'type' => 'radio', 'std' => '150', 'options' => array( '150' => __('150 × 150 – Default', 'asr'), '200' => __('200 × 120 – Horizontal', 'asr')) ); /*------------------------------------- Single --------------------------------------*/ $options[] = array('name' => __('Single View', 'asr'), 'type' => 'heading'); $options[] = array( 'name' => __('Post Elements', 'asr'), 'id' => 'post_elements', 'type' => 'multicheck', 'std' => array( 'author' => '1', 'published' => '1', 'categories' => '1', 'comment_info' => '1', 'updated' => '1', 'tags' => '1', 'author_box' => '0', 'post_nav' => '1', 'comments' => '1'), 'options' => array( 'author' => __('Byline Author', 'asr'), 'published' => __('Byline Date Published', 'asr'), 'categories' => __('Byline Categories', 'asr'), 'comment_info' => __('Byline Comment Info', 'asr'), 'updated' => __('Show Date Updated', 'asr'), 'tags' => __('Show Tags', 'asr'), 'author_box' => __('Show Author Box', 'asr'), 'post_nav' => __('Show Post Navigation', 'asr'), 'comments' => __('Enable Comments', 'asr')) ); $options[] = array( 'name' => __('Page Elements', 'asr'), 'id' => 'page_elements', 'type' => 'multicheck', 'std' => array( 'author' => '0', 'published' => '0', 'comment_info' => '0', 'updated' => '0', 'author_box' => '0', 'comments' => '1'), 'options' => array( 'author' => __('Byline Author', 'asr'), 'published' => __('Byline Date Published', 'asr'), 'comment_info' => __('Byline Comment Info', 'asr'), 'updated' => __('Show Date Updated', 'asr'), 'author_box' => __('Show Author Box', 'asr'), 'comments' => __('Enable Comments', 'asr')) ); /*------------------------------------- Widget Areas --------------------------------------*/ $options[] = array('name' => __('Widgets', 'asr'), 'type' => 'heading'); $options[] = array( 'name' => __('Widget Areas', 'asr'), 'id' => 'widget_areas', 'type' => 'multicheck', 'std' => array( 'body' => '0', 'header' => '1', 'below_menu' => '0', 'before_content' => '0', 'after_content' => '0', 'footer' => '1', 'post_header' => '1', 'post_before_content' => '1', 'post_after_content' => '1', 'post_footer' => '1'), 'options' => array( 'body' => __('Body', 'asr'), 'header' => __('Header', 'asr'), 'below_menu' => __('Below Menu', 'asr'), 'before_content' => __('Before Content', 'asr'), 'after_content' => __('After Content', 'asr'), 'footer' => __('Footer', 'asr'), 'post_header' => __('Post - Header', 'asr'), 'post_before_content' => __('Post - Before Content', 'asr'), 'post_after_content' => __('Post - After Content', 'asr'), 'post_footer' => __('Post - Footer', 'asr')) ); $options[] = array( 'name' => __('Footer Widget Columns', 'asr'), 'desc' => __('Choose how many footer widgets per row to display. Footer must be enabled on Widget Areas option.', 'asr'), 'id' => 'footer_widget_columns', 'type' => 'radio', 'std' => '3', 'options' => array( '1' => __('1 Column', 'asr'), '2' => __('2 Columns', 'asr'), '3' => __('3 Columns', 'asr'), '4' => __('4 Columns', 'asr'), '5' => __('5 Columns', 'asr'), '6' => __('6 Columns', 'asr')) ); /*------------------------------------- Colors --------------------------------------*/ $options[] = array('name' => __('Colors', 'asr'), 'type' => 'heading'); $options[] = array( 'name' => __('Custom Colors', 'asr'), 'desc' => __('Check box to enable the color options below. Other elements not included here can be changed through the Custom CSS option. Background color for the body area can be set here: Body Background', 'asr'), 'id' => 'colors_enable', 'type' => 'checkbox', 'std' => '0'); $options[] = array( 'name' => __('Primary Color', 'asr'), 'desc' => __('This is the main accent color. This sets the colors for widget title background, top borders, genericons, reply buttons and various elements.', 'asr'), 'id' => 'color_motif', 'type' => 'color', 'std' => '#2A5A8E'); $options[] = array( 'name' => __('', 'asr'), 'desc' => __('Top Bar', 'asr'), 'id' => 'color_top_bar', 'type' => 'color', 'std' => '#222222'); $options[] = array( 'desc' => __('Header', 'asr'), 'id' => 'color_header', 'type' => 'color', 'std' => '#FFFFFF'); $options[] = array( 'desc' => __('Main Menu', 'asr'), 'id' => 'color_menu_main', 'type' => 'color', 'std' => '#2A5A8E'); $options[] = array( 'desc' => __('Bottom Bar', 'asr'), 'id' => 'color_bottom_bar', 'type' => 'color', 'std' => '#222222'); $options[] = array( 'name' => __('', 'asr'), 'desc' => __('Link Color', 'asr'), 'id' => 'color_links', 'type' => 'color', 'std' => '#0E4D7A'); $options[] = array( 'desc' => __('Link Hover Color', 'asr'), 'id' => 'color_links_hover', 'type' => 'color', 'std' => '#0000EE'); /*------------------------------------- Slider --------------------------------------*/ $options[] = array('name' => __('Slider', 'asr'), 'type' => 'heading'); $options[] = array( 'name' => __('Enable Slider', 'asr'), 'desc' => __('Activate slider. The slider is shown on the Front Page and Posts Page.', 'asr'), 'id' => 'slider_enable', 'type' => 'checkbox', 'std' => '0'); if ( $options_categories ) { $options[] = array( 'name' => __('Slider Categories', 'asr'), 'desc' => __('Select the categories to show on slider. You can select or deselect items by holding down the CTRL key while clicking. Creating a category specifically for use on the slider may be ideal.', 'asr'), 'id' => 'slider_categories', 'type' => 'multiselect', 'options' => $options_categories); } $options[] = array( 'name' => __('Post Count', 'asr'), 'desc' => __('How many posts should the slider show. Starts with the most recent post.', 'asr'), 'id' => 'slider_post_count', 'type' => 'text', 'std' => '6', 'class' => 'mini'); $options[] = array( 'name' => __('Slide Duration', 'asr'), 'desc' => __('How many milliseconds before switching to the next slide.', 'asr'), 'id' => 'slider_pause_time', 'type' => 'text', 'std' => '5000', 'class' => 'mini'); $options[] = array( 'name' => __('Animation Speed', 'asr'), 'desc' => __('How many milliseconds should the slide transition take.', 'asr'), 'id' => 'slider_slide_speed', 'type' => 'text', 'std' => '500', 'class' => 'mini'); $options[] = array( 'name' => __('Slider Position', 'asr'), 'desc' => __('Select where to position the slider. The slider expands to full width when positioned below the menu and is normal size when positioned before the content.', 'asr'), 'id' => 'slider_position', 'type' => 'radio', 'std' => 'before_content', 'options' => array( 'before_main' => __('Below Menu', 'asr'), 'before_content' => __('Before Content', 'asr')) ); $options[] = array( 'name' => __('Slider Height', 'asr'), 'id' => 'slider_height', 'type' => 'text', 'std' => '340', 'class' => 'mini px-after'); $options[] = array( 'name' => __('Slider Elements', 'asr'), 'id' => 'slider_elements', 'type' => 'multicheck', 'std' => array( 'title' => '1', 'text' => '1'), 'options' => array( 'title' => __('Show Post Title', 'asr'), 'text' => __('Show Post Text', 'asr')) ); $options[] = array( 'name' => __('Slider Image Style', 'asr'), 'id' => 'slider_stretch', 'type' => 'radio', 'std' => 'stretch', 'options' => array( 'stretch' => __('Stretch Image to fit Slider.', 'asr'), 'no_stretch'=> __('Don\'t Stretch. Center the Image.', 'asr')) ); $options[] = array( 'name' => __('Default Slider Image', 'asr'), 'desc' => __('Choose the default image shown on the slider. This image will only be used if a Featured Image is not available on the post.', 'asr'), 'id' => 'slider_default_image', 'type' => 'upload', 'std' => $sliderimage); /*------------------------------------- CSS --------------------------------------*/ $options[] = array('name' => __('Custom CSS', 'asr'), 'type' => 'heading'); $options[] = array( 'name' => __('CSS', 'asr'), 'id' => 'custom_css', 'type' => 'textarea', 'class' => 'css'); /*------------------------------------- Misc --------------------------------------*/ $options[] = array('name' => __('Misc', 'asr'), 'type' => 'heading'); $options[] = array( 'name' => __('Custom <Head> Codes', 'asr'), 'id' => 'head_codes', 'type' => 'textarea', 'class' => 'code'); $options[] = array( 'name' => __('Disable Responsive Layout', 'asr'), 'desc' => __('Check if you do not want the layout to resize and adapt to the screen size.', 'asr'), 'id' => 'responsive_disable', 'type' => 'checkbox', 'std' => '0'); $options[] = array( 'name' => __('Disable Editor Style', 'asr'), 'desc' => __('Remove any custom styles applied to the post visual editor (e.g. Post Editor Width)', 'asr'), 'id' => 'editor_style_disable', 'type' => 'checkbox', 'std' => '0'); $options[] = array( 'name' => __('Remove Theme URL', 'asr'), 'desc' => __('Remove theme credit on bottom bar. Please consider either keeping the link or donating to show support.', 'asr'), 'id' => 'theme_link_disable', 'type' => 'checkbox', 'std' => '0'); return $options; } add_filter( 'optionsframework_multiselect', 'multiselect_type', 10, 3 ); add_filter( 'optionsframework_slider_ui_width_container', 'slider_ui_width_container_type', 10, 3 ); add_filter( 'optionsframework_slider_ui_width_2col', 'slider_ui_width_2col_type', 10, 3 ); add_filter( 'optionsframework_slider_ui_width_3col', 'slider_ui_width_3col_type', 10, 3 ); add_filter( 'of_sanitize_multiselect', 'of_sanitize_multiselect', 10, 2 ); add_filter( 'of_sanitize_slider_ui_width_container', 'sanitize_text_field' ); add_filter( 'of_sanitize_slider_ui_width_2col', 'sanitize_text_field' ); add_filter( 'of_sanitize_slider_ui_width_3col', 'sanitize_text_field' ); function multiselect_type( $option_name, $value, $val ) { $output = ''; return $output; } function of_sanitize_multiselect( $input, $option ) { $output = ''; if ( is_array( $input ) ) { foreach( $option['options'] as $key => $value ) { $output[$key] = '0'; foreach( $input as $selected_val ) { if($key == $selected_val) $output[$key] = '1'; } } } return $output; } function slider_ui_width_container_type( $option_name, $value, $val ) { $output = ''; $output .= '
'; $output .= ''; return $output; } function slider_ui_width_2col_type( $option_name, $value, $val ) { $output = ''; $output .= ''; $output .= ''; $output .= ''; return $output; } function slider_ui_width_3col_type( $option_name, $value, $val ) { $output = ''; $output .= ''; $output .= ''; $output .= ''; $output .= ''; return $output; } function asr_slider_ui_js() { ?> array(), "src" => array()); $custom_allowedtags["meta"] = array("property" => array(), "name" => array(), "content" => array()); $custom_allowedtags["link"] = array("id" => array(), "media" => array(), "type" => array(), "href" => array(), "rel" => array(), "property" => array(), "content" => array()); $custom_allowedtags = array_merge($custom_allowedtags, $allowedposttags); $output = wp_kses( $input, $custom_allowedtags ); $output = htmlspecialchars_decode( $output ); return $output; } function asr_options_page_sidebar() { ?>