'.__('+More','carblog').''); return $trimmed_content; } get_template_part('theme_includes/settings-class'); /*********************************************************** * Our Options ************************************************************/ if (!class_exists('Carblog_Settings' )): class Carblog_Settings { private $settings_api; function __construct() { $this->settings_api = new Carblog_Settings_API; add_action( 'admin_init', array($this, 'admin_init') ); add_action( 'admin_menu', array($this, 'admin_menu') ); } function admin_init() { //set the settings $this->settings_api->set_sections( $this->get_settings_sections() ); $this->settings_api->set_fields( $this->get_settings_fields() ); //initialize settings $this->settings_api->admin_init(); } function admin_menu() { add_theme_page('Carblog Settings', 'Carblog Settings', 'delete_posts', OPTIONS_PREFIX.'theme_settings', array($this, 'plugin_page')); } function get_settings_sections() { $sections = array( array( 'id' => OPTIONS_PREFIX.'general', 'title' => __( 'Carblog General', 'carblog' ), 'desc'=>__('Favicon and Logo Settings','carblog') ), array( 'id' => OPTIONS_PREFIX.'socials', 'title' => __( 'Carblog Social', 'carblog' ), 'desc'=>__('Facebook,Twitter, G+ etc settings.','carblog') ), array( 'id' => OPTIONS_PREFIX.'featured_post_settings', 'title' => __( 'Featured Posts Settings', 'carblog' ), 'desc'=>__('Featured Post Category, featured posts excerpts length.','carblog') ), array( 'id' => OPTIONS_PREFIX.'footer_columns', 'title' => __( 'Carblog Footer', 'carblog' ), 'desc'=>__('Fill the footer columns with your text.','carblog') ), ); return $sections; } function get_settings_fields() { //Access the WordPress Categories via an Array $categories = array(); $categories_obj = get_categories('hide_empty=0'); foreach ($categories_obj as $cat) { $categories[$cat->cat_ID] = ucwords($cat->cat_name); } $settings_fields = array( OPTIONS_PREFIX.'general' => array( array( 'name' => 'favicon', 'label' => __( 'Your Favicon', 'carblog' ), 'desc' => __( '

If you have a favicon (16x16px) please upload it here.

','carblog' ), 'type' => 'file', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'logo', 'label' => __( 'Your Logo', 'carblog' ), 'desc' => __( '

Do you a have a logo to upload?If yes, use the media uploader.Suggested logo dimensions are 375x125px.

', 'carblog' ), 'type' => 'file', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'top_area_text', 'label' => __( 'Top Area Slogan', 'carblog' ), 'desc' => __( '

This is the message that appears between the date and the social icons, at the top.

Keep it small and simple, up to three-seven words.Leave it blank and the message will disappear

', 'carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'sanitize_text_field' ) ), OPTIONS_PREFIX.'socials' => array( array( 'name' => 'facebook', 'label' => __( 'Facebook URL', 'carblog' ), 'desc' => __( 'Your Facebook URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'twitter', 'label' => __( 'Twitter URL', 'carblog' ), 'desc' => __( 'Your Twitter URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'google_plus', 'label' => __( 'Google Plus URL', 'carblog' ), 'desc' => __( 'Your Google Plus URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'rss', 'label' => __( 'RSS URL', 'carblog' ), 'desc' => __( 'Your Feed/RSS URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'instagram', 'label' => __( 'Instagram URL', 'carblog' ), 'desc' => __( 'Your Instagram Page URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'pinterest', 'label' => __( 'Pinterest URL', 'carblog' ), 'desc' => __( 'Your Pinterest URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'linkedin', 'label' => __( 'Linkedin URL', 'carblog' ), 'desc' => __( 'Your Linkedin URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'dribbble', 'label' => __( 'Dribbble URL', 'carblog' ), 'desc' => __( 'Your Dribbble URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ), array( 'name' => 'youtube', 'label' => __( 'Youtube Channel URL', 'carblog' ), 'desc' => __( 'Your Youtube Channel URL.','carblog' ), 'type' => 'text', 'default' => '', 'sanitize_callback'=>'esc_url_raw' ) ), OPTIONS_PREFIX.'featured_post_settings' => array( array( 'name' => 'disable_featured', 'label' => __( 'Disable Featured Posts', 'carblog' ), 'desc' => __( 'If you want to disable featuted posts, then tick "Yes".
This setting overrides the "featured post category" setting below.', 'carblog' ), 'type' => 'radio', 'default'=>'yes', 'options' => array( 'yes' => 'Yes', 'no' => 'No' )), array( 'name' => 'featured_category', 'label' => __( 'Featured Post Category', 'carblog' ), 'desc' => __( 'Select the category of the fearured posts', 'carblog' ), 'type' => 'select', 'options' => $categories ), array( 'name' => 'featured_posts_number', 'label' => __( 'Featured Posts Number', 'carblog' ), 'desc' => __( 'Select the number of the featured posts.', 'carblog' ), 'type' => 'select', 'default'=>'2', 'options' => array( '1'=>'1', '2'=>'2', '3'=>'3', '4'=>'4', '5'=>'5', '6'=>'6', '7'=>'7', '8'=>'8', '9'=>'9', '10'=>'10' ) ) ), OPTIONS_PREFIX.'footer_columns'=>array( array( 'name' => 'footer_column_one_header', 'label' => __( 'Title for the first footer column', 'carblog' ), 'desc' => __( 'Title of the first footer column.', 'carblog' ), 'type' => 'text', 'sanitize_callback'=>'sanitize_text_field' ), array( 'name' => 'footer_column_one', 'label' => __( 'First from the left Footer Column', 'carblog' ), 'desc' => __( 'Fill this column with your text/HTML', 'carblog' ), 'type' => 'textarea', 'sanitize_callback'=>'wp_kses_post' ), array( 'name' => 'footer_column_two_header', 'label' => __( 'Title for the second footer column', 'carblog' ), 'desc' => __( 'Title of the second -from the left- footer column.', 'carblog' ), 'type' => 'text', 'sanitize_callback'=>'sanitize_text_field' ), array( 'name' => 'footer_column_two', 'label' => __( 'Second from the left Footer Column', 'carblog' ), 'desc' => __( 'Fill this column with your text/HTML', 'carblog' ), 'type' => 'textarea', 'sanitize_callback'=>'wp_kses_post' ), array( 'name' => 'footer_column_three_header', 'label' => __( 'Title for the third footer column', 'carblog' ), 'desc' => __( 'Title of the third-from the left- footer column.', 'carblog' ), 'type' => 'text', 'sanitize_callback'=>'sanitize_text_field' ), array( 'name' => 'footer_column_three', 'label' => __( 'Second from the right Footer Column', 'carblog' ), 'desc' => __( 'Fill this column with your text/HTML', 'carblog' ), 'type' => 'textarea', 'sanitize_callback'=>'wp_kses_post' ), array( 'name' => 'footer_column_four_header', 'label' => __( 'Title for the fourth footer column', 'carblog' ), 'desc' => __( 'Title of the fourth-from the left- footer column.', 'carblog' ), 'type' => 'text', 'sanitize_callback'=>'sanitize_text_field' ), array( 'name' => 'footer_column_four', 'label' => __( 'First from the right Footer Column', 'carblog' ), 'desc' => __( 'Fill this column with your text/HTML', 'carblog' ), 'type' => 'textarea', 'sanitize_callback'=>'wp_kses_post' ) ) ); return $settings_fields; } function plugin_page() { echo '
'; $this->settings_api->show_navigation(); $this->settings_api->show_forms(); echo '
'; } /** * Get all the pages * * @return array page names with key value pairs */ function get_pages() { $pages = get_pages(); $pages_options = array(); if ( $pages ) { foreach ($pages as $page) { $pages_options[$page->ID] = $page->post_title; } } return $pages_options; } } endif; $settings = new Carblog_Settings(); function cb_option( $option, $section, $default = '' ) { $options = get_option( $section ); if ( isset( $options[$option] ) ) { return $options[$option]; } return $default; } /*** * BREADCRUMBS WITHOUT A PLUGIN */ function the_breadcrumb() { global $post; echo ''; } ?>