コード例 #1
0
function barcelona_theme_options()
{
    /* OptionTree is not loaded yet, or this is not an admin request */
    if (!function_exists('ot_settings_id') || !is_admin()) {
        return false;
    }
    /*
     * Get a copy of the saved settings array.
     */
    $barcelona_saved_settings = get_option('option_tree_settings', array());
    /*
     * Google Font Options
     */
    $barcelona_font_choices = array(array('label' => 'Montserrat', 'value' => 'Montserrat'), array('label' => 'Open Sans', 'value' => 'Open+Sans'), array('label' => 'Open Sans Condensed', 'value' => 'Open+Sans+Condensed'), array('label' => 'Source Sans', 'value' => 'Source+Sans'), array('label' => 'PT Sans', 'value' => 'PT+Sans'), array('label' => 'PT Serif', 'value' => 'PT+Serif'), array('label' => 'Josefin Sans', 'value' => 'Josefin+Sans'), array('label' => 'Arvo', 'value' => 'Arvo'), array('label' => 'Lato', 'value' => 'Lato'), array('label' => 'Vollkorn', 'value' => 'Vollkorn'), array('label' => 'Ubuntu', 'value' => 'Ubuntu'), array('label' => 'Droid Sans', 'value' => 'Droid+Sans'));
    /*
     * Color Scheme Options
     */
    $barcelona_color_scheme_choices = array(array('label' => esc_html__('Light', 'barcelona'), 'value' => 'light'), array('label' => esc_html__('Dark', 'barcelona'), 'value' => 'dark'));
    /*
     * Posts Layout Options
     */
    $barcelona_posts_layout_choices = array(array('value' => 'c', 'label' => esc_html__('List A', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/pmodule-a.png'), array('value' => 'd', 'label' => esc_html__('List B', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/pmodule-b.png'), array('value' => 'i', 'label' => esc_html__('1 Column Layout', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/pmodule-d.png'), array('value' => 'h', 'label' => esc_html__('2 Columns Layout', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/pmodule-c.png'), array('value' => 'j', 'label' => esc_html__('3 Columns Layout', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/pmodule-e.png'), array('value' => 'k', 'label' => esc_html__('4 Columns Layout', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/pmodule-f.png'));
    /*
     * Sidebar Position Options
     */
    $barcelona_sidebar_position_choices = array(array('value' => 'right', 'label' => esc_html__('Sidebar Left', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/sidebar-' . (is_rtl() ? 'left' : 'right') . '.jpg'), array('value' => 'left', 'label' => esc_html__('Sidebar Right', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/sidebar-' . (is_rtl() ? 'right' : 'left') . '.jpg'), array('value' => 'none', 'label' => esc_html__('No Sidebar', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/sidebar-none.jpg'));
    /*
     * Featured Image Options
     */
    $barcelona_fi_choices = array(array('value' => 'cl', 'label' => esc_html__('Classic Featured Image', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/fimg-cl.jpg'), array('value' => 'fw', 'label' => esc_html__('Full Width Featured Image', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/fimg-fw.jpg'), array('value' => 'sw', 'label' => esc_html__('Screen Width Featured Image', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/fimg-sw.jpg'), array('value' => 'sp', 'label' => esc_html__('Screen Width Parallax Featured Image', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/fimg-sp.jpg'));
    /*
     * Order by Field Options
     */
    $barcelona_orderby_choices = array(array('value' => 'date', 'label' => esc_html__('Date', 'barcelona')), array('value' => 'views', 'label' => esc_html__('Number of Views', 'barcelona')), array('value' => 'comments', 'label' => esc_html__('Number of Comments', 'barcelona')), array('value' => 'votes', 'label' => esc_html__('Number of Votes', 'barcelona')), array('value' => 'random', 'label' => esc_html__('Random', 'barcelona')), array('value' => 'posts', 'label' => esc_html__('Manual Post IDs', 'barcelona')));
    /*
     * Custom settings array that will eventually be
     * passes to the OptionTree Settings API Class.
     */
    $barcelona_custom_settings = array('sections' => array(array('id' => 'ot-logos-icons', 'title' => '<i class="fa fa-picture-o"></i> ' . esc_html__('Logos & Icons', 'barcelona')), array('id' => 'ot-layout-settings', 'title' => '<i class="fa fa-sitemap"></i> ' . esc_html__('Layout Settings', 'barcelona')), array('id' => 'ot-sidebar-settings', 'title' => '<i class="fa fa-columns"></i> ' . esc_html__('Sidebar Settings', 'barcelona')), array('id' => 'ot-social-settings', 'title' => '<i class="fa fa-share-alt"></i> ' . esc_html__('Social Settings', 'barcelona')), array('id' => 'ot-typography', 'title' => '<i class="fa fa-align-left"></i> ' . esc_html__('Typography', 'barcelona')), array('id' => 'ot-custom-codes', 'title' => '<i class="fa fa-code"></i> ' . esc_html__('Custom Codes', 'barcelona')), array('id' => 'ot-color-scheme', 'title' => '<i class="fa fa-paint-brush"></i> ' . esc_html__('Color Scheme', 'barcelona')), array('id' => 'ot-advertisement', 'title' => '<i class="fa fa-bullhorn"></i> ' . esc_html__('Advertisement', 'barcelona'))), 'settings' => array(array('id' => 'barcelona_show_header_logo_as_text', 'label' => esc_html__('Display Header Logo as Text', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-logos-icons'), array('id' => 'barcelona_header_logo_text', 'label' => esc_html__('Header Logo Text', 'barcelona'), 'type' => 'text', 'section' => 'ot-logos-icons', 'condition' => 'barcelona_show_header_logo_as_text:is(on)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_header_dark_logo_url', 'label' => esc_html__('Header Logo URL (Dark Version)', 'barcelona'), 'desc' => esc_html__('Put the URL of logo for dark version or upload new one for header. (Recommended size: 200px by 90px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons', 'condition' => 'barcelona_show_header_logo_as_text:is(off)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_header_dark_retina_logo_url', 'label' => esc_html__('Header Retina Logo URL (Dark Version)', 'barcelona'), 'desc' => esc_html__('Double size of header logo for dark version. (Recommended size: 400px by 180px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons', 'condition' => 'barcelona_show_header_logo_as_text:is(off)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_header_light_logo_url', 'label' => esc_html__('Header Logo URL (Light Version)', 'barcelona'), 'desc' => esc_html__('Put the URL of logo for light version or upload new one for header. (Recommended size: 200px by 90px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons', 'condition' => 'barcelona_show_header_logo_as_text:is(off)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_header_light_retina_logo_url', 'label' => esc_html__('Header Retina Logo URL (Light Version)', 'barcelona'), 'desc' => esc_html__('Double size of header logo for light version. (Recommended size: 400px by 180px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons', 'condition' => 'barcelona_show_header_logo_as_text:is(off)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_show_footer_logo_as_text', 'label' => esc_html__('Display Footer Logo as Text', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-logos-icons'), array('id' => 'barcelona_footer_logo_text', 'label' => esc_html__('Footer Logo Text', 'barcelona'), 'type' => 'text', 'section' => 'ot-logos-icons', 'condition' => 'barcelona_show_footer_logo_as_text:is(on)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_footer_dark_logo_url', 'label' => esc_html__('Footer Logo URL (Dark Version)', 'barcelona'), 'desc' => esc_html__('(Recommended size: 200px X 90px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons', 'condition' => 'barcelona_show_footer_logo_as_text:is(off)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_footer_dark_retina_logo_url', 'label' => esc_html__('Footer Retina Logo URL (Dark Version)', 'barcelona'), 'desc' => esc_html__('(Recommended size: 400px X 180px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons', 'condition' => 'barcelona_show_footer_logo_as_text:is(off)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_footer_light_logo_url', 'label' => esc_html__('Footer Logo URL (Light Version)', 'barcelona'), 'desc' => esc_html__('(Recommended size: 200px X 90px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons', 'condition' => 'barcelona_show_footer_logo_as_text:is(off)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_footer_light_retina_logo_url', 'label' => esc_html__('Footer Retina Logo URL (Light Version)', 'barcelona'), 'desc' => esc_html__('(Recommended size: 400px X 180px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons', 'condition' => 'barcelona_show_footer_logo_as_text:is(off)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_favicon_url', 'label' => esc_html__('Favicon URL', 'barcelona'), 'desc' => esc_html__('(Recommended min. size: 32px X 32px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons'), array('id' => 'barcelona_apple_touch_icon_iphone', 'label' => esc_html__('Apple Iphone Icon URL', 'barcelona'), 'desc' => esc_html__('(57px X 57px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons'), array('id' => 'barcelona_apple_touch_icon_ipad', 'label' => esc_html__('Apple Ipad Icon URL', 'barcelona'), 'desc' => esc_html__('(72px X 72px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons'), array('id' => 'barcelona_apple_touch_icon_retina', 'label' => esc_html__('Apple Retina Icon URL', 'barcelona'), 'desc' => esc_html__('(144px X 144px)', 'barcelona'), 'type' => 'upload', 'section' => 'ot-logos-icons'), array('id' => 'barcelona_layout_tab_general', 'label' => esc_html__('General', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_boxed_layout', 'label' => esc_html__('Boxed Layout', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_sticky_nav_bar', 'label' => esc_html__('Sticky Navigation Bar', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_sticky_sidebars', 'label' => esc_html__('Sticky Sidebars', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_disqus_comments', 'label' => esc_html__('Enable Disqus Comment System', 'barcelona'), 'desc' => esc_html__('Find more info about Disqus: https://disqus.com', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_disqus_sitename', 'label' => esc_html__('Disqus URL', 'barcelona'), 'desc' => esc_html__('E.g YOUR_SHORTNAME.disqus.com - Get your Disqus Url here: https://publishers.disqus.com/engage', 'barcelona'), 'type' => 'text', 'section' => 'ot-layout-settings', 'class' => 'barcelona-setting-indent', 'condition' => 'barcelona_disqus_comments:is(on)'), array('id' => 'barcelona_layout_tab_header', 'label' => esc_html__('Header', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_header_style', 'label' => esc_html__('Header Style', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'class' => 'barcelona-radio-img-horizontal', 'choices' => array(array('value' => 'a', 'label' => esc_html__('Logo + Ad Area', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/header-a.png'), array('value' => 'b', 'label' => esc_html__('Centered Logo Only', 'barcelona'), 'src' => BARCELONA_THEME_PATH . 'includes/admin/images/header-b.png'))), array('id' => 'barcelona_show_top_bar_menu', 'label' => esc_html__('Display Top Bar Menu', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_header_social_icons', 'label' => esc_html__('Display Social Icons', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_layout_tab_footer', 'label' => esc_html__('Footer', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_footer_sidebars', 'label' => esc_html__('Enable Footer Sidebars', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_footer_logo', 'label' => esc_html__('Display Logo on Footer', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_footer_menu', 'label' => esc_html__('Display Menu on Footer', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_footer_copyright_text', 'label' => esc_html__('Footer Copyright Text', 'barcelona'), 'type' => 'textarea-simple', 'section' => 'ot-layout-settings', 'rows' => 3), array('id' => 'barcelona_layout_tab_megamenu', 'label' => esc_html__('Mega Menu', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_mm_orderby', 'label' => esc_html__('Order Mega Menu Posts by', 'barcelona'), 'type' => 'select', 'std' => 'date', 'choices' => $barcelona_orderby_choices, 'section' => 'ot-layout-settings'), array('id' => 'barcelona_mm_order', 'label' => esc_html__('Mega Menu Posts Order Type', 'barcelona'), 'type' => 'select', 'choices' => array(array('value' => 'asc', 'label' => esc_html__('Ascending', 'barcelona')), array('value' => 'desc', 'label' => esc_html__('Descending', 'barcelona'))), 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_tags_under_mm', 'label' => esc_html__('Display Popular Tags Under Mega Menu', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_layout_tab_single', 'label' => esc_html__('Single Post', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_featured_image_style__single', 'label' => esc_html__('Featured Image Style', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_fi_choices), array('id' => 'barcelona_default_sidebar__single', 'label' => esc_html__('Single Post Sidebar', 'barcelona'), 'type' => 'sidebar-select', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_sidebar_position__single', 'label' => esc_html__('Single Post Sidebar Position', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_sidebar_position_choices), array('id' => 'barcelona_show_breadcrumb__single', 'label' => esc_html__('Display Breadcrumb', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_comments__single', 'label' => esc_html__('Display Comments', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_tags__single', 'label' => esc_html__('Display Tags', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_social_sharing__single', 'label' => esc_html__('Display Social Sharing', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_author_box__single', 'label' => esc_html__('Display Author Box', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_voting__single', 'label' => esc_html__('Display Voting Buttons', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_voting_login_req__single', 'label' => esc_html__('Only logged-in users can vote', 'barcelona'), 'type' => 'on-off', 'class' => 'barcelona-setting-indent', 'condition' => 'barcelona_show_voting__single:is(on)', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_post_nav__single', 'label' => esc_html__('Display Post Navigation', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_related_posts__single', 'label' => esc_html__('Display Related Posts', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_post_meta_choices__single', 'label' => __('Post Meta Data', 'theme-text-domain'), 'desc' => __('Check which meta data to show for single post', 'barcelona'), 'std' => '', 'type' => 'checkbox', 'choices' => array(array('value' => 'date', 'label' => __('Post Date', 'theme-text-domain')), array('value' => 'views', 'label' => __('Post Views', 'theme-text-domain')), array('value' => 'likes', 'label' => __('Post Votes', 'barcelona')), array('value' => 'comments', 'label' => __('Post Comments', 'barcelona')), array('value' => 'categories', 'label' => __('Post Categories', 'barcelona'))), 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_post_content_ad__single', 'label' => esc_html__('Display Post Content Ad', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_post_content_ad_1__single', 'label' => esc_html__('Single Post Content Ad (728x90)', 'barcelona'), 'desc' => esc_html__('Put the ad code to single post content for large screens.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_show_post_content_ad__single:is(on)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_post_content_ad_2__single', 'label' => esc_html__('Single Post Content Ad (468x60)', 'barcelona'), 'desc' => esc_html__('Put the ad code to single post content for small screens.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_show_post_content_ad__single:is(on)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_add_header_ad__single', 'label' => esc_html__('Header Ad for Single Post', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_header_ad_1__single', 'label' => esc_html__('Header Ad for Large Screens (728x90)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for large screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__single:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_header_ad_2__single', 'label' => esc_html__('Header Ad for Small Screens (468x60)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for small screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__single:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_set_background__single', 'label' => esc_html__('Background for Single Post', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_custom_background__single', 'label' => esc_html__('Background', 'barcelona'), 'type' => 'background', 'section' => 'ot-layout-settings', 'condition' => 'barcelona_set_background__single:is(custom)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_layout_tab_page', 'label' => esc_html__('Page', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_featured_image_style__page', 'label' => esc_html__('Featured Image Style', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_fi_choices), array('id' => 'barcelona_default_sidebar__page', 'label' => esc_html__('Page Sidebar', 'barcelona'), 'type' => 'sidebar-select', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_sidebar_position__page', 'label' => esc_html__('Page Sidebar Position', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_sidebar_position_choices), array('id' => 'barcelona_show_comments__page', 'label' => esc_html__('Display Comments', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_social_sharing__page', 'label' => esc_html__('Display Social Sharing', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_voting__page', 'label' => esc_html__('Display Voting Buttons', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_voting_login_req__page', 'label' => esc_html__('Only logged-in users can vote', 'barcelona'), 'type' => 'on-off', 'class' => 'barcelona-setting-indent', 'condition' => 'barcelona_show_voting__page:is(on)', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_set_background__page', 'label' => esc_html__('Background for Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_custom_background__page', 'label' => esc_html__('Background', 'barcelona'), 'type' => 'background', 'section' => 'ot-layout-settings', 'condition' => 'barcelona_set_background__page:is(custom)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_layout_tab_category', 'label' => esc_html__('Category', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_posts_layout__category', 'label' => esc_html__('Category Posts Layout', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_posts_layout_choices), array('id' => 'barcelona_default_sidebar__category', 'label' => esc_html__('Category Page Sidebar', 'barcelona'), 'type' => 'sidebar-select', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_sidebar_position__category', 'label' => esc_html__('Category Page Sidebar Position', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_sidebar_position_choices), array('id' => 'barcelona_show_breadcrumb__category', 'label' => esc_html__('Display Breadcrumb', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_add_header_ad__category', 'label' => esc_html__('Header Ad for Category Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_header_ad_1__category', 'label' => esc_html__('Header Ad for Large Screens (728x90)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for large screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__category:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_header_ad_2__category', 'label' => esc_html__('Header Ad for Small Screens (468x60)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for small screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__category:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_set_background__category', 'label' => esc_html__('Background for Category Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_custom_background__category', 'label' => esc_html__('Background', 'barcelona'), 'type' => 'background', 'section' => 'ot-layout-settings', 'condition' => 'barcelona_set_background__category:is(custom)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_layout_tab_author', 'label' => esc_html__('Author', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_posts_layout__author', 'label' => esc_html__('Author Posts Layout', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_posts_layout_choices), array('id' => 'barcelona_default_sidebar__author', 'label' => esc_html__('Author Page Sidebar', 'barcelona'), 'type' => 'sidebar-select', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_sidebar_position__author', 'label' => esc_html__('Author Page Sidebar Position', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_sidebar_position_choices), array('id' => 'barcelona_show_breadcrumb__author', 'label' => esc_html__('Display Breadcrumb', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_show_author_box__author', 'label' => esc_html__('Display Author Bio', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_add_header_ad__author', 'label' => esc_html__('Header Ad for Author Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_header_ad_1__author', 'label' => esc_html__('Header Ad for Large Screens (728x90)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for large screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__author:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_header_ad_2__author', 'label' => esc_html__('Header Ad for Small Screens (468x60)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for small screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__author:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_set_background__author', 'label' => esc_html__('Background for Author Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_custom_background__author', 'label' => esc_html__('Background', 'barcelona'), 'type' => 'background', 'section' => 'ot-layout-settings', 'condition' => 'barcelona_set_background__author:is(custom)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_layout_tab_search', 'label' => esc_html__('Search', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_posts_layout__search', 'label' => esc_html__('Search Posts Layout', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_posts_layout_choices), array('id' => 'barcelona_default_sidebar__search', 'label' => esc_html__('Search Page Sidebar', 'barcelona'), 'type' => 'sidebar-select', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_sidebar_position__search', 'label' => esc_html__('Search Page Sidebar Position', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_sidebar_position_choices), array('id' => 'barcelona_show_breadcrumb__search', 'label' => esc_html__('Display Breadcrumb', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_add_header_ad__search', 'label' => esc_html__('Header Ad for Search Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_header_ad_1__search', 'label' => esc_html__('Header Ad for Large Screens (728x90)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for large screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__search:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_header_ad_2__search', 'label' => esc_html__('Header Ad for Small Screens (468x60)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for small screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__search:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_set_background__search', 'label' => esc_html__('Background for Search Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_custom_background__search', 'label' => esc_html__('Background', 'barcelona'), 'type' => 'background', 'section' => 'ot-layout-settings', 'condition' => 'barcelona_set_background__search:is(custom)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_layout_tab_tag', 'label' => esc_html__('Tag', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_posts_layout__tag', 'label' => esc_html__('Tag Posts Layout', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_posts_layout_choices), array('id' => 'barcelona_default_sidebar__tag', 'label' => esc_html__('Tag Page Sidebar', 'barcelona'), 'type' => 'sidebar-select', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_sidebar_position__tag', 'label' => esc_html__('Tag Page Sidebar Position', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_sidebar_position_choices), array('id' => 'barcelona_show_breadcrumb__tag', 'label' => esc_html__('Display Breadcrumb', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_add_header_ad__tag', 'label' => esc_html__('Header Ad for Tag Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_header_ad_1__tag', 'label' => esc_html__('Header Ad for Large Screens (728x90)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for large screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__tag:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_header_ad_2__tag', 'label' => esc_html__('Header Ad for Small Screens (468x60)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for small screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__tag:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_set_background__tag', 'label' => esc_html__('Background for Tag Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_custom_background__tag', 'label' => esc_html__('Background', 'barcelona'), 'type' => 'background', 'section' => 'ot-layout-settings', 'condition' => 'barcelona_set_background__tag:is(custom)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_layout_tab_home', 'label' => esc_html__('Posts Page', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_posts_layout__home', 'label' => esc_html__('Posts Page Layout', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_posts_layout_choices), array('id' => 'barcelona_default_sidebar__home', 'label' => esc_html__('Posts Page Sidebar', 'barcelona'), 'type' => 'sidebar-select', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_sidebar_position__home', 'label' => esc_html__('Posts Page Sidebar Position', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_sidebar_position_choices), array('id' => 'barcelona_show_breadcrumb__home', 'label' => esc_html__('Display Breadcrumb', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_add_header_ad__home', 'label' => esc_html__('Header Ad for Posts Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_header_ad_1__home', 'label' => esc_html__('Header Ad for Large Screens (728x90)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for large screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__home:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_header_ad_2__home', 'label' => esc_html__('Header Ad for Small Screens (468x60)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for small screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__home:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_set_background__home', 'label' => esc_html__('Background for Posts Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_custom_background__home', 'label' => esc_html__('Background', 'barcelona'), 'type' => 'background', 'section' => 'ot-layout-settings', 'condition' => 'barcelona_set_background__home:is(custom)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_layout_tab_archive', 'label' => esc_html__('Archives', 'barcelona'), 'type' => 'tab', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_posts_layout__archive', 'label' => esc_html__('Archive Posts Layout', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_posts_layout_choices), array('id' => 'barcelona_default_sidebar__archive', 'label' => esc_html__('Archive Page Sidebar', 'barcelona'), 'type' => 'sidebar-select', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_sidebar_position__archive', 'label' => esc_html__('Archive Page Sidebar Position', 'barcelona'), 'type' => 'radio-image', 'section' => 'ot-layout-settings', 'choices' => $barcelona_sidebar_position_choices), array('id' => 'barcelona_show_breadcrumb__archive', 'label' => esc_html__('Display Breadcrumb', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-layout-settings'), array('id' => 'barcelona_add_header_ad__archive', 'label' => esc_html__('Header Ad for Archive Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_header_ad_1__archive', 'label' => esc_html__('Header Ad for Large Screens (728x90)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for large screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'operator' => 'and', 'condition' => 'barcelona_add_header_ad__archive:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_header_ad_2__archive', 'label' => esc_html__('Header Ad for Small Screens (468x60)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for small screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 4, 'section' => 'ot-layout-settings', 'condition' => 'barcelona_add_header_ad__archive:is(custom)', 'class' => 'barcelona-setting-indent barcelona-textarea-code'), array('id' => 'barcelona_set_background__archive', 'label' => esc_html__('Background for Archive Page', 'barcelona'), 'type' => 'select', 'section' => 'ot-layout-settings', 'choices' => array(array('value' => 'inherit', 'label' => esc_html__('Inherit (Same as global setting)', 'barcelona')), array('value' => 'custom', 'label' => esc_html__('Custom', 'barcelona')))), array('id' => 'barcelona_custom_background__archive', 'label' => esc_html__('Background', 'barcelona'), 'type' => 'background', 'section' => 'ot-layout-settings', 'condition' => 'barcelona_set_background__archive:is(custom)', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_default_sidebar', 'label' => esc_html__('Default Sidebar', 'barcelona'), 'desc' => esc_html__('Choose any sidebar that you created. This will be default for all layouts.', 'barcelona'), 'type' => 'sidebar-select', 'section' => 'ot-sidebar-settings'), array('id' => 'barcelona_sidebars', 'label' => esc_html__('Sidebars', 'barcelona'), 'desc' => esc_html__('Create custom sidebar to use on various layouts.', 'barcelona'), 'type' => 'list-item', 'section' => 'ot-sidebar-settings', 'settings' => array()), array('id' => 'barcelona_social_rss_feed_url', 'label' => esc_html__('RSS Feed URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_social_facebook_url', 'label' => esc_html__('Facebook URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_social_twitter_url', 'label' => esc_html__('Twitter URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_social_google_plus_url', 'label' => esc_html__('Google Plus URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_social_linkedin_url', 'label' => esc_html__('Linkedin URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_social_youtube_url', 'label' => esc_html__('Youtube URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_social_vimeo_url', 'label' => esc_html__('Vimeo URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_social_vk_url', 'label' => esc_html__('VK URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_social_instagram_url', 'label' => esc_html__('Instagram URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_social_pinterest_url', 'label' => esc_html__('Pinterest URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_social_github_url', 'label' => esc_html__('Github URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_social_flickr_url', 'label' => esc_html__('Flickr URL', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings'), array('id' => 'barcelona_facebook_app_settings_title', 'label' => esc_html__('Facebook App Settings', 'barcelona'), 'type' => 'textblock-titled', 'section' => 'ot-social-settings', 'class' => 'barcelona-title-bar'), array('id' => 'barcelona_facebook_app_id', 'label' => esc_html__('Facebook App ID', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_add_facebook_og_tags', 'label' => esc_html__('Add Facebook Open Graph Tags to Header', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-social-settings', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_add_facebook_sdk', 'label' => esc_html__('Add Facebook SDK to Header', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-social-settings', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_twitter_app_settings_title', 'label' => esc_html__('Twitter App Settings', 'barcelona'), 'desc' => esc_html__('In order to get the application info visit https://apps.twitter.com/ and create new app.', 'barcelona'), 'type' => 'textblock-titled', 'section' => 'ot-social-settings', 'class' => 'barcelona-title-bar'), array('id' => 'barcelona_twitter_access_token', 'label' => esc_html__('Access Token', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_twitter_access_token_secret', 'label' => esc_html__('Access Token Secret', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_twitter_consumer_key', 'label' => esc_html__('Consumer Key', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_twitter_consumer_secret', 'label' => esc_html__('Consumer Secret', 'barcelona'), 'type' => 'text', 'section' => 'ot-social-settings', 'class' => 'barcelona-setting-indent'), array('id' => 'barcelona_font_headings', 'label' => esc_html__('Font for Headings', 'barcelona'), 'desc' => esc_html__('Select a font to use for general headings. Default is Montserrat.', 'barcelona'), 'type' => 'select', 'section' => 'ot-typography', 'choices' => $barcelona_font_choices), array('id' => 'barcelona_font_general', 'label' => esc_html__('General Body Text', 'barcelona'), 'desc' => esc_html__('Select a font to use for general body text. Default is Montserrat', 'barcelona'), 'type' => 'select', 'section' => 'ot-typography', 'choices' => $barcelona_font_choices), array('id' => 'barcelona_font_latin_ext', 'label' => esc_html__('Use Latin Extended Charset', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-typography'), array('id' => 'barcelona_font_cyrillic_ext', 'label' => esc_html__('Use Cyrillic Extended Charset', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-typography'), array('id' => 'barcelona_font_greek_charset', 'label' => esc_html__('Use Greek Charset', 'barcelona'), 'type' => 'on-off', 'section' => 'ot-typography'), array('id' => 'barcelona_header_custom_code', 'label' => esc_html__('Header Custom Code', 'barcelona'), 'type' => 'textarea-simple', 'section' => 'ot-custom-codes', 'rows' => '10', 'class' => 'barcelona-textarea-code'), array('id' => 'barcelona_footer_custom_code', 'label' => esc_html__('Footer Custom Code', 'barcelona'), 'type' => 'textarea-simple', 'section' => 'ot-custom-codes', 'rows' => '10', 'class' => 'barcelona-textarea-code'), array('id' => 'barcelona_css_custom_code', 'label' => esc_html__('CSS Custom Code', 'barcelona'), 'type' => 'css', 'section' => 'ot-custom-codes'), array('id' => 'barcelona_top_nav_color_scheme', 'label' => esc_html__('Top Navigation Bar Color Scheme', 'barcelona'), 'type' => 'select', 'section' => 'ot-color-scheme', 'choices' => $barcelona_color_scheme_choices), array('id' => 'barcelona_footer_color_scheme', 'label' => esc_html__('Footer Color Scheme', 'barcelona'), 'type' => 'select', 'section' => 'ot-color-scheme', 'choices' => $barcelona_color_scheme_choices), array('id' => 'barcelona_megamenu_color_scheme', 'label' => esc_html__('Mega Menu Color Scheme', 'barcelona'), 'type' => 'select', 'section' => 'ot-color-scheme', 'choices' => $barcelona_color_scheme_choices), array('id' => 'barcelona_selection_color', 'label' => esc_html__('Selection Color', 'barcelona'), 'type' => 'colorpicker', 'section' => 'ot-color-scheme'), array('id' => 'barcelona_header_ad_1', 'label' => esc_html__('Header Ad for Large Screens (728x90)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for large screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 6, 'section' => 'ot-advertisement', 'class' => 'barcelona-textarea-code barcelona-textarea-code'), array('id' => 'barcelona_header_ad_2', 'label' => esc_html__('Header Ad for Small Screens (468x60)', 'barcelona'), 'desc' => esc_html__('Put the ad code to header for small screen sizes.', 'barcelona'), 'type' => 'textarea-simple', 'rows' => 6, 'section' => 'ot-advertisement', 'class' => 'barcelona-textarea-code barcelona-textarea-code')));
    /*
     * Get standard values of all settings
     */
    foreach ($barcelona_custom_settings['settings'] as $k => $v) {
        $barcelona_std = barcelona_get_option($v['id'], true);
        if (!empty($barcelona_std)) {
            $barcelona_custom_settings['settings'][$k]['std'] = $barcelona_std;
        }
    }
    /*
     * Allow settings to be filtered before saving
     */
    $barcelona_custom_settings = apply_filters('option_tree_settings_args', $barcelona_custom_settings);
    /*
     * If settings are not the same update the DB
     */
    if ($barcelona_saved_settings !== $barcelona_custom_settings) {
        update_option('option_tree_settings', $barcelona_custom_settings);
    }
    return true;
}
コード例 #2
0
ファイル: single.php プロジェクト: yalmaa/little-magazine
                echo esc_attr(wp_create_nonce('barcelona-post-vote'));
                ?>
" data-type="down" data-vote-type="post">
								<span class="fa fa-thumbs-down"></span><?php 
                esc_html_e('Vote Down', 'barcelona');
                ?>
							</button>
						</div>

					</div><!-- .post-vote -->
					<?php 
            }
            ?>

					<?php 
            if (barcelona_get_option('show_social_sharing') == 'on') {
                ?>
					<div class="post-sharing">

						<ul class="list-inline text-center">
							<li><a href="https://www.facebook.com/sharer/sharer.php?u=<?php 
                echo urlencode(get_the_permalink());
                ?>
" target="_blank" title="<?php 
                printf(esc_html__('Share on %s', 'barcelona'), 'Facebook');
                ?>
"><span class="fa fa-facebook"></span></a></li>
							<li><a href="https://twitter.com/home?status=<?php 
                echo urlencode(get_the_title() . ' - ' . get_the_permalink());
                ?>
" target="_blank" title="<?php 
コード例 #3
0
ファイル: scripts.php プロジェクト: yalmaa/little-magazine
function barcelona_footer_custom_code()
{
    $barcelona_code = barcelona_get_option('footer_custom_code');
    $barcelona_background = barcelona_get_background(true);
    if (!empty($barcelona_background)) {
        if (empty($barcelona_code)) {
            $barcelona_code = '';
        }
        $barcelona_code .= "\n<script>jQuery(document).ready(function(\$){ \$.backstretch('" . esc_url($barcelona_background) . "'); });</script>";
    }
    // Add footer custom code
    if (!empty($barcelona_code)) {
        // We trust the author here. The author can add custom html to footer.
        echo $barcelona_code . "\n";
    }
}
コード例 #4
0
ファイル: sidebar.php プロジェクト: yalmaa/little-magazine
<?php

if (barcelona_get_option('sidebar_position') == 'none') {
    return;
}
$barcelona_sidebar = barcelona_get_option('default_sidebar');
if (function_exists('buddypress') && is_buddypress()) {
    $barcelona_sidebar = 'barcelona-buddypress-sidebar';
} else {
    if (function_exists('bbpress') && is_bbpress()) {
        $barcelona_sidebar = 'barcelona-bbpress-sidebar';
    }
}
?>
<aside id="sidebar" class="<?php 
echo esc_attr(barcelona_sidebar_class());
?>
">

	<div class="sidebar-inner">

		<?php 
dynamic_sidebar($barcelona_sidebar);
?>

	</div><!-- .sidebar-inner -->

</aside>
コード例 #5
0
/**
 * Featured Posts
 */
function barcelona_featured_posts()
{
    global $barcelona_mod_header;
    $barcelona_fp_type = 'category';
    $barcelona_has_autoplay = false;
    if (is_page_template('page-modules.php')) {
        global $post;
        $barcelona_fp_type = 'page';
        $barcelona_q = barcelona_get_featured_posts_query($post->ID, $barcelona_fp_type);
        $barcelona_has_autoplay = get_post_meta($post->ID, 'barcelona_fp_is_autoplay', true) == 'on';
    } else {
        if (is_category()) {
            $barcelona_cat_id = get_query_var('cat');
            $barcelona_q = barcelona_get_featured_posts_query($barcelona_cat_id, $barcelona_fp_type);
            $barcelona_has_autoplay = barcelona_get_option('fp_is_autoplay__category_' . $barcelona_cat_id) == 'on';
        }
    }
    if (!isset($barcelona_q) || !$barcelona_q) {
        return false;
    }
    if ($barcelona_q->have_posts()) {
        $barcelona_fp_style = $barcelona_q->fp_style;
        $barcelona_owl_data = array('dots' => 'false', 'items' => 2, 'center' => 'false', 'nav' => 'true', 'rtl' => is_rtl() ? 'true' : 'false', 'breakpoint' => '0:1,992:', 'loop' => 'false', 'slideby' => 2);
        if ($barcelona_has_autoplay) {
            $barcelona_owl_data['loop'] = 'true';
            $barcelona_owl_data['autoplay'] = 'true';
        }
        if ($barcelona_fp_style == 'a') {
            $barcelona_owl_data['items'] = $barcelona_owl_data['slideby'] = 1;
            $barcelona_owl_data['breakpoint'] .= '1';
        } else {
            $barcelona_owl_data['breakpoint'] .= '2';
        }
        ?>
		<div class="featured-posts fptype-<?php 
        echo sanitize_html_class($barcelona_fp_type);
        ?>
 fpstyle-<?php 
        echo sanitize_html_class($barcelona_fp_style);
        ?>
">

			<div class="container">

				<div class="owl-carousel owl-theme"<?php 
        echo implode(array_map(function ($v, $k) {
            return ' data-' . sanitize_key($k) . '="' . esc_attr($v) . '"';
        }, $barcelona_owl_data, array_keys($barcelona_owl_data)));
        ?>
>

					<?php 
        $i = 0;
        while ($barcelona_q->have_posts()) {
            $barcelona_q->the_post();
            $barcelona_h = 2;
            if ($barcelona_fp_style == 'c' && ($i + 1) % 3 != 0 || $barcelona_fp_style == 'd' && $i % 3 != 0 || $barcelona_fp_style == 'e') {
                $barcelona_h = 1;
            }
            if (($barcelona_fp_style == 'c' && $barcelona_q->post_count % 3 == 1 || $barcelona_fp_style == 'd' && $barcelona_q->post_count % 3 == 2) && $i == $barcelona_q->post_count - 1) {
                $barcelona_h = 2;
            }
            $barcelona_c = $barcelona_fp_style == 'a' ? 1 : 2;
            $barcelona_thumbnail_url = barcelona_get_thumbnail_url('barcelona-lg');
            ?>

					<?php 
            if (($barcelona_fp_style != 'c' || ($i - 1) % 3 != 0) && ($barcelona_fp_style != 'd' || ($i + 1) % 3 != 0)) {
                ?>
					<div class="item fp-col">
					<?php 
            }
            ?>

						<div id="fpBox<?php 
            echo intval($i + 1);
            ?>
" class="post-summary fp-box fp-box-h<?php 
            echo intval($barcelona_h);
            ?>
 fp-box-c<?php 
            echo intval($barcelona_c);
            ?>
" data-bg="<?php 
            echo esc_url($barcelona_thumbnail_url[0]);
            ?>
">
							<a href="<?php 
            echo esc_url(get_the_permalink());
            ?>
" class="fp-inner">
								<div class="vm-wrapper">
									<div class="vm-middle">
										<h2 class="post-title"><?php 
            echo esc_html(get_the_title());
            ?>
</h2>
										<ul class="post-meta no-sep">
											<li class="post-date"><span class="fa fa-clock-o"></span><?php 
            echo esc_html(get_the_time(BARCELONA_DATE_FORMAT));
            ?>
</li>
										</ul>
									</div>
								</div>
							</a>
						</div>

						<?php 
            if (!barcelona_is_empty($barcelona_thumbnail_url[0])) {
                ?>
						<script>jQuery(document).ready(function($){ $('#fpBox<?php 
                echo intval($i + 1);
                ?>
').backstretch('<?php 
                echo esc_url($barcelona_thumbnail_url[0]);
                ?>
', {fade: 400}); });</script>
						<?php 
            }
            ?>

					<?php 
            if (($barcelona_fp_style != 'c' || $i % 3 != 0) && ($barcelona_fp_style != 'd' || ($i - 1) % 3 != 0) || $i == $barcelona_q->post_count - 1) {
                ?>
					</div>
					<?php 
            }
            ?>

					<?php 
            $i++;
        }
        wp_reset_postdata();
        ?>

				</div>

			</div>

		</div><!-- .featured-posts -->
		<?php 
        if (isset($barcelona_mod_header)) {
            echo '<div class="container">' . $barcelona_mod_header . '</div>';
        }
        return true;
    }
}
コード例 #6
0
ファイル: archive.php プロジェクト: yalmaa/little-magazine
}
?>
<div class="container">

	<div class="<?php 
echo esc_attr(barcelona_row_class());
?>
">

		<main id="main" class="<?php 
echo esc_attr(barcelona_main_class());
?>
">
		<?php 
if (is_author() && barcelona_get_option('show_author_box') == 'on') {
    barcelona_author_box();
}
include locate_template('includes/modules/module-' . barcelona_get_option('posts_layout') . '.php');
barcelona_page_nav();
?>
		</main>

		<?php 
get_sidebar();
?>

	</div><!-- .row -->

</div><!-- .container -->
<?php 
get_footer();
コード例 #7
0
ファイル: comments.php プロジェクト: yalmaa/little-magazine
    if (comments_open()) {
        ?>
		<div class="comment-form-row row">
		<?php 
        $barcelona_wp_kses_allowable_html = array('a' => array('href' => array(), 'title' => array()));
        comment_form(array('title_reply' => esc_html__('Comment', 'barcelona'), 'title_reply_to' => esc_html__('Comment to %s', 'barcelona'), 'logged_in_as' => '<div class="col-md-12"><p class="form-before-text">' . sprintf(wp_kses(__('Logged in as <a href="%1$s">%2$s</a>. <a href="%3$s" title="Log out of this account">Log out?</a>', 'barcelona'), $barcelona_wp_kses_allowable_html), get_edit_user_link(), $barcelona_user_identity, wp_logout_url(apply_filters('the_permalink', get_permalink()))) . '</p></div>', 'cancel_reply_link' => esc_html__('Cancel Reply', 'barcelona'), 'label_submit' => esc_html__('Post Comment', 'barcelona'), 'class_submit' => 'btn btn-red-2 btn-submit-comment', 'comment_notes_after' => '', 'comment_notes_before' => '', 'must_log_in' => '<div class="col-md-12"><p class="form-before-text alert alert-danger">' . sprintf(wp_kses(__('You must be <a href="%s">logged in</a> to post a comment.', 'barcelona'), $barcelona_wp_kses_allowable_html), wp_login_url(apply_filters('the_permalink', get_permalink()))) . '</p></div>', 'comment_field' => '<div class="col-sm-12"><div class="form-group comment-form-comment"><textarea id="comment" class="form-control" name="comment" rows="10" placeholder="' . esc_html_x('Comment', 'noun', 'barcelona') . ' *" required="required"></textarea></div></div>', 'submit_field' => '<div class="col-sm-12"><div class="form-group form-submit">%1$s %2$s</div></div>', 'submit_button' => '<button type="submit" name="%1$s" id="%2$s" class="%3$s">%4$s</button>', 'format' => 'html5', 'fields' => array('author' => '<div class="col-sm-6"><div class="form-group comment-form-author"><input id="author" class="form-control" type="text" name="author" placeholder="' . esc_html__('Name', 'barcelona') . ($barcelona_req ? ' *' : '') . '" value="' . esc_attr($barcelona_commenter['comment_author']) . '" size="30"' . $barcelona_aria_req . $barcelona_html_req . '></div></div>', 'email' => '<div class="col-sm-6"><div class="form-group comment-form-email"><input id="email" class="form-control" type="email" name="email" placeholder="' . esc_html__('Email', 'barcelona') . ($barcelona_req ? ' *' : '') . '" value="' . esc_attr($barcelona_commenter['comment_author_email']) . '" size="30"' . $barcelona_aria_req . $barcelona_html_req . '></div></div>', 'url' => '<div class="col-sm-12"><div class="form-group comment-form-url"><input id="url" class="form-control" type="url" name="url" placeholder="' . esc_html__('Website', 'barcelona') . '" value="' . esc_attr($barcelona_commenter['comment_author_url']) . '" size="30"></div></div>')));
        ?>
		</div><!-- .comment-form-row -->
		<?php 
    }
    ?>

	</div><!-- #comments -->
<?php 
} else {
    $barcelona_disqus_sitename = barcelona_get_option('disqus_sitename');
    if (preg_match('#^([a-z]+)\\.disqus\\.com$#', $barcelona_disqus_sitename)) {
        $barcelona_disqus_sitename = str_replace('.disqus.com', '', $barcelona_disqus_sitename);
        ?>
		<div id="disqus_thread"></div>
		<script>
			var disqus_config = function () {
				this.page.url = '<?php 
        echo esc_url(get_the_permalink());
        ?>
';
				this.page.identifier = '<?php 
        echo esc_html(get_the_title());
        ?>
';
			};
コード例 #8
0
ファイル: filters.php プロジェクト: yalmaa/little-magazine
function barcelona_body_class($classes)
{
    if (barcelona_get_option('boxed_layout') == 'on') {
        $classes[] = 'boxed-layout';
    }
    $barcelona_bg = barcelona_get_background();
    if (empty($barcelona_bg)) {
        $barcelona_bg = barcelona_get_background(true);
    }
    if ((get_background_color() !== get_theme_support('custom-background', 'default-color') || get_background_image() || !empty($barcelona_bg)) && !in_array('boxed-layout', $classes)) {
        $classes[] = 'boxed-layout-bg';
        if (!empty($barcelona_bg)) {
            $classes[] = 'po-bg';
        }
    }
    if (class_exists('Mobile_Detect')) {
        $barcelona_detect = new Mobile_Detect();
        if ($barcelona_detect->isTablet()) {
            $classes[] = 'barcelona-device-tablet';
        } else {
            if ($barcelona_detect->isMobile()) {
                $classes[] = 'barcelona-device-mobile';
            }
        }
    }
    if (is_singular()) {
        $barcelona_fimg_id = barcelona_get_option('featured_image_style');
        $barcelona_post_format = barcelona_get_post_format();
        $barcelona_is_media = in_array($barcelona_post_format, array('audio', 'gallery', 'video'), true);
        if ($barcelona_is_media && in_array($barcelona_fimg_id, array('sp', 'fp', 'fs'), true)) {
            $barcelona_fimg_id = 'sw';
        }
        if (in_array($barcelona_post_format, array('gallery', 'video'), true) && $barcelona_fimg_id != 'cl') {
            $barcelona_fimg_id = 'fw';
        }
        $classes[] = 'barcelona-fimg-' . $barcelona_fimg_id;
    }
    if (is_single() || is_category()) {
        $classes[] = barcelona_get_option('show_breadcrumb') != 'on' ? 'no-breadcrumb' : 'has-breadcrumb';
    }
    return $classes;
}
コード例 #9
0
ファイル: helpers.php プロジェクト: yalmaa/little-magazine
function barcelona_get_featured_posts_query($id, $type)
{
    if ($type == 'page') {
        $barcelona_opts = array('style' => get_post_meta($id, 'barcelona_fp_style', true), 'number' => get_post_meta($id, 'barcelona_fp_max_number_of_posts', true), 'offset' => get_post_meta($id, 'barcelona_fp_posts_offset', true), 'cat' => get_post_meta($id, 'barcelona_fp_filter_category', true), 'tag' => get_post_meta($id, 'barcelona_fp_filter_tag', true), 'post' => get_post_meta($id, 'barcelona_fp_filter_post', true), 'orderby' => get_post_meta($id, 'barcelona_fp_orderby', true), 'order' => get_post_meta($id, 'barcelona_fp_order', true));
    } else {
        if ($type == 'category') {
            $barcelona_opts = array('style' => barcelona_get_option('fp_style__category_' . $id), 'number' => barcelona_get_option('fp_max_number_of_posts__category_' . $id), 'offset' => barcelona_get_option('fp_posts_offset__category_' . $id), 'cat' => array($id), 'tag' => barcelona_get_option('fp_filter_tag__category_' . $id), 'post' => barcelona_get_option('fp_filter_post__category_' . $id), 'orderby' => barcelona_get_option('fp_orderby__category_' . $id), 'order' => barcelona_get_option('fp_order__category_' . $id));
        }
    }
    if (!isset($barcelona_opts) || $barcelona_opts['style'] == 'none') {
        return false;
    }
    $barcelona_params = array('posts_per_page' => $barcelona_opts['number'], 'post_type' => 'post', 'post_status' => 'publish', 'ignore_sticky_posts' => true, 'no_found_rows' => true);
    /*
     * Posts Offset
     */
    if (is_numeric($barcelona_opts['offset'])) {
        $barcelona_params['offset'] = $barcelona_opts['offset'];
    }
    /*
     * Filter Posts by Category
     */
    if (!empty($barcelona_opts['cat'])) {
        $barcelona_params['category__in'] = array_values($barcelona_opts['cat']);
    }
    /*
     * Filter Posts by Post IDs
     */
    if (!empty($barcelona_opts['post'])) {
        $barcelona_params['post__in'] = array_values(array_filter(array_map(function ($v) {
            $v = trim($v);
            if (!is_numeric($v) || $v <= 0) {
                $v = false;
            }
            return $v;
        }, explode(',', $barcelona_opts['post'])), function ($v) {
            return is_numeric($v);
        }));
    }
    /*
     * Filter Posts by Tag Name
     */
    if (!empty($barcelona_opts['tag'])) {
        $barcelona_tag_names = array_filter(explode(',', $barcelona_opts['tag']));
        if (!empty($barcelona_tag_names)) {
            foreach ($barcelona_tag_names as $barcelona_tag) {
                $barcelona_tag_term = get_term_by('name', trim($barcelona_tag), 'post_tag');
                if ($barcelona_tag_term) {
                    $barcelona_params['tag__in'][] = $barcelona_tag_term->term_id;
                }
            }
        }
    }
    /*
     * Posts Ordering
     */
    switch ($barcelona_opts['orderby']) {
        case 'views':
            $barcelona_params['orderby'] = 'meta_value_num';
            $barcelona_params['meta_key'] = '_barcelona_views';
            break;
        case 'comments':
            $barcelona_params['orderby'] = 'comment_count';
            break;
        case 'votes':
            $barcelona_params['orderby'] = 'meta_value_num';
            $barcelona_params['meta_key'] = '_barcelona_vote_up';
            break;
        case 'random':
            $barcelona_params['orderby'] = 'rand';
            break;
        case 'posts':
            $barcelona_params['orderby'] = 'post__in';
            break;
        default:
            $barcelona_params['orderby'] = 'date';
    }
    $barcelona_params['order'] = $barcelona_opts['order'] != 'asc' ? 'DESC' : 'ASC';
    $barcelona_query = new WP_Query($barcelona_params);
    $barcelona_query->fp_style = $barcelona_opts['style'];
    return $barcelona_query;
}
コード例 #10
0
ファイル: nav-menu.php プロジェクト: yalmaa/little-magazine
    /**
     * Start the element output.
     *
     * @see Walker::start_el()
     *
     * @since 3.0.0
     *
     * @param string $output Passed by reference. Used to append additional content.
     * @param object $item   Menu item data object.
     * @param int    $depth  Depth of menu item. Used for padding.
     * @param array  $args   An array of arguments. @see wp_nav_menu()
     * @param int    $id     Current item ID.
     */
    function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
    {
        $indent = $depth ? str_repeat("\t", $depth) : '';
        $classes = empty($item->classes) ? array() : (array) $item->classes;
        $classes[] = 'menu-item-' . intval($item->ID);
        $barcelona_has_mega_menu = $item->menu_item_parent == '0' && $item->barcelonamegamenu == '1';
        if ($barcelona_has_mega_menu) {
            $classes = array_unique(array_merge($classes, array('menu-item-mega-menu', 'menu-item-has-children')));
        }
        /**
         * Filter the CSS class(es) applied to a menu item's list item element.
         *
         * @since 3.0.0
         * @since 4.1.0 The `$depth` parameter was added.
         *
         * @param array  $classes The CSS classes that are applied to the menu item's `<li>` element.
         * @param object $item    The current menu item.
         * @param array  $args    An array of {@see wp_nav_menu()} arguments.
         * @param int    $depth   Depth of menu item. Used for padding.
         */
        $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args, $depth));
        $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';
        /**
         * Filter the ID applied to a menu item's list item element.
         *
         * @since 3.0.1
         * @since 4.1.0 The `$depth` parameter was added.
         *
         * @param string $menu_id The ID that is applied to the menu item's `<li>` element.
         * @param object $item    The current menu item.
         * @param array  $args    An array of {@see wp_nav_menu()} arguments.
         * @param int    $depth   Depth of menu item. Used for padding.
         */
        $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args, $depth);
        $id = $id ? ' id="' . esc_attr($id) . '"' : '';
        $output .= $indent . '<li' . $id . $class_names . '>';
        /**
         * Filter the HTML attributes applied to a menu item's anchor element.
         *
         * @since 3.6.0
         * @since 4.1.0 The `$depth` parameter was added.
         *
         * @param array $atts {
         *     The HTML attributes applied to the menu item's `<a>` element, empty strings are ignored.
         *
         *     @type string $title  Title attribute.
         *     @type string $target Target attribute.
         *     @type string $rel    The rel attribute.
         *     @type string $href   The href attribute.
         * }
         * @param object $item  The current menu item.
         * @param array  $args  An array of {@see wp_nav_menu()} arguments.
         * @param int    $depth Depth of menu item. Used for padding.
         */
        $atts = array();
        $atts['title'] = !empty($item->attr_title) ? $item->attr_title : '';
        $atts['target'] = !empty($item->target) ? $item->target : '';
        $atts['rel'] = !empty($item->xfn) ? $item->xfn : '';
        $atts['href'] = !empty($item->url) ? $item->url : '';
        $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args, $depth);
        $attributes = '';
        foreach ($atts as $attr => $value) {
            if (!empty($value)) {
                $value = 'href' === $attr ? esc_url($value) : esc_attr($value);
                $attributes .= ' ' . $attr . '="' . $value . '"';
            }
        }
        $item_output = $args->before;
        $item_output .= '<a' . $attributes . '>';
        /** This filter is documented in wp-includes/post-template.php */
        $item_output .= $args->link_before . do_shortcode($item->title) . $args->link_after;
        $item_output .= '</a>';
        $item_output .= $args->after;
        /**
         * Filter a menu item's starting output.
         *
         * The menu item's starting output only includes `$args->before`, the opening `<a>`,
         * the menu item's title, the closing `</a>`, and `$args->after`. Currently, there is
         * no filter for modifying the opening and closing `<li>` for a menu item.
         *
         * @since 3.0.0
         *
         * @param string $item_output The menu item's starting HTML output.
         * @param object $item        Menu item data object.
         * @param int    $depth       Depth of menu item. Used for padding.
         * @param array  $args        An array of {@see wp_nav_menu()} arguments.
         */
        $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
        if ($barcelona_has_mega_menu) {
            $args = array('cat' => $item->object_id, 'posts_per_page' => -1, 'post_status' => 'publish', 'ignore_sticky_posts' => 1);
            /*
             * Posts Ordering
             */
            switch (barcelona_get_option('mm_orderby')) {
                case 'views':
                    $args['orderby'] = 'meta_value_num';
                    $args['meta_key'] = '_barcelona_views';
                    break;
                case 'comments':
                    $args['orderby'] = 'comment_count';
                    break;
                case 'votes':
                    $args['orderby'] = 'meta_value_num';
                    $args['meta_key'] = '_barcelona_vote_up';
                    break;
                case 'random':
                    $args['orderby'] = 'rand';
                    break;
                case 'posts':
                    $args['orderby'] = 'post__in';
                    break;
                default:
                    $args['orderby'] = 'date';
            }
            $args['order'] = barcelona_get_option('mm_order') != 'asc' ? 'DESC' : 'ASC';
            $latest_posts = new WP_Query($args);
            $post_ids = array();
            $i = 0;
            if ($latest_posts->have_posts()) {
                $barcelona_mm_posts = '<div class="posts-wrapper row">';
                while ($latest_posts->have_posts()) {
                    $latest_posts->the_post();
                    $post_ids[] = get_the_ID();
                    $barcelona_mm_posts .= '<div class="col col-xs-3">
											<div class="post-summary post-format-' . sanitize_html_class(barcelona_get_post_format()) . '">
												<div class="post-image">
													<a href="' . esc_url(get_the_permalink()) . '" title="' . esc_attr(get_the_title()) . '">' . barcelona_psum_overlay(false) . barcelona_get_thumbnail('barcelona-sm') . '</a>
												</div>
												<div class="post-details">
													<h2 class="post-title">
														<a href="' . esc_url(get_the_permalink()) . '">' . esc_html(get_the_title()) . '</a>
													</h2>
													<ul class="post-meta no-sep">
														<li class="post-date">
															<span class="fa fa-clock-o"></span>' . get_the_time(BARCELONA_DATE_FORMAT) . '
														</li>
													</ul>
												</div>
											</div>
										</div>';
                    $i++;
                    if ($i == 4) {
                        break;
                    }
                }
                wp_reset_postdata();
                $barcelona_mm_posts .= '</div>';
                // Mega Menu Bottom
                $barcelona_mm_bottom = '<div class="mm-bottom row"><div class="col col-sm-9">';
                // Show popular tags under mega menu
                if (barcelona_get_option('show_tags_under_mm') == 'on') {
                    $tags = array();
                    foreach ($post_ids as $k) {
                        $post_tags = wp_get_post_tags($k, array('orderby' => 'count', 'order' => 'DESC'));
                        foreach ($post_tags as $tag) {
                            $tags[$tag->term_id] = $tag;
                        }
                    }
                    if (count($tags)) {
                        usort($tags, function ($a, $b) {
                            return $a->count < $b->count;
                        });
                        $tags = array_slice($tags, 0, 5);
                        $barcelona_mm_bottom .= '<div class="tag-list"><div class="title">' . esc_html__('Popular Tags:', 'barcelona') . '</div><div class="list">';
                        foreach ($tags as $tag) {
                            $barcelona_mm_bottom .= '<a href="' . esc_url(get_term_link($tag)) . '">' . esc_html($tag->name) . '</a>,';
                        }
                        $barcelona_mm_bottom = rtrim($barcelona_mm_bottom, ',') . '</div></div>';
                    }
                }
                // Add "see all" link to the bottom
                $barcelona_mm_bottom .= '</div><div class="col col-sm-3"><div class="see-all"><a href="' . esc_url($item->url) . '">' . esc_html__('See All', 'barcelona') . '</a></div></div>';
                // Close .mm-bottom
                $barcelona_mm_bottom .= '</div>';
                $output .= '<div class="mega-menu">' . $barcelona_mm_posts . $barcelona_mm_bottom . '</div>';
            }
            // have_posts
        }
    }
コード例 #11
0
ファイル: header.php プロジェクト: yalmaa/little-magazine
		<?php 
if (in_array('on', $barcelona_top_bar)) {
    ?>
		<div class="navbar-top clearfix">

			<div class="navbar-top-left clearfix">
				<?php 
    if ($barcelona_top_bar['show_top_bar_menu'] == 'on') {
        wp_nav_menu(array('theme_location' => 'top', 'container' => false, 'menu_class' => 'navbar-top-menu'));
    }
    ?>
			</div>

			<div class="navbar-top-right">
				<?php 
    if (barcelona_get_option('show_header_social_icons') == 'on') {
        echo $barcelona_social_icons;
    }
    ?>
			</div>

		</div><!-- .navbar-top -->
		<?php 
}
?>

		<div class="navbar-header">

			<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false">
				<span class="sr-only">Menu</span>
				<span class="fa fa-navicon"></span>
コード例 #12
0
ファイル: meta-boxes.php プロジェクト: yalmaa/little-magazine
function barcelona_save_category_meta_fields($term_id)
{
    if (array_key_exists('barcelona_cat', $_POST) && is_array($_POST['barcelona_cat'])) {
        $barcelona_meta = array();
        $barcelona_meta['fp_style'] = isset($_POST['barcelona_cat']['fp_style']) ? sanitize_key($_POST['barcelona_cat']['fp_style']) : sanitize_key(barcelona_get_option('fp_style__category'));
        $barcelona_meta['fp_max_number_of_posts'] = is_numeric($_POST['barcelona_cat']['fp_max_number_of_posts']) ? intval($_POST['barcelona_cat']['fp_max_number_of_posts']) : intval(barcelona_get_option('fp_max_number_of_posts__category'));
        $barcelona_meta['fp_posts_offset'] = is_numeric($_POST['barcelona_cat']['fp_posts_offset']) ? intval($_POST['barcelona_cat']['fp_posts_offset']) : intval(barcelona_get_option('fp_posts_offset__category'));
        $barcelona_meta['fp_filter_tag'] = isset($_POST['barcelona_cat']['fp_filter_tag']) ? sanitize_text_field($_POST['barcelona_cat']['fp_filter_tag']) : sanitize_text_field(barcelona_get_option('fp_filter_tag__category'));
        $barcelona_meta['fp_filter_post'] = isset($_POST['barcelona_cat']['fp_filter_post']) ? sanitize_text_field($_POST['barcelona_cat']['fp_filter_post']) : sanitize_text_field(barcelona_get_option('fp_filter_post__category'));
        $barcelona_meta['fp_orderby'] = isset($_POST['barcelona_cat']['fp_orderby']) ? sanitize_key($_POST['barcelona_cat']['fp_orderby']) : sanitize_key(barcelona_get_option('fp_orderby__category'));
        $barcelona_meta['fp_order'] = isset($_POST['barcelona_cat']['fp_order']) ? sanitize_key($_POST['barcelona_cat']['fp_order']) : sanitize_key(barcelona_get_option('fp_order__category'));
        $barcelona_meta['posts_layout'] = isset($_POST['barcelona_cat']['posts_layout']) ? sanitize_key($_POST['barcelona_cat']['posts_layout']) : sanitize_key(barcelona_get_option('posts_layout__category'));
        $barcelona_meta['default_sidebar'] = isset($_POST['barcelona_cat']['sidebar']) ? sanitize_text_field($_POST['barcelona_cat']['sidebar']) : sanitize_text_field(barcelona_get_option('default_sidebar__category'));
        $barcelona_meta['sidebar_position'] = isset($_POST['barcelona_cat']['sidebar_position']) ? sanitize_key($_POST['barcelona_cat']['sidebar_position']) : sanitize_key(barcelona_get_option('sidebar_position__category'));
        $barcelona_meta['show_breadcrumb'] = isset($_POST['barcelona_cat']['show_breadcrumb']) ? sanitize_key($_POST['barcelona_cat']['show_breadcrumb']) : sanitize_key(barcelona_get_option('show_breadcrumb__category'));
        $barcelona_meta['show_cat_title'] = isset($_POST['barcelona_cat']['show_cat_title']) ? sanitize_key($_POST['barcelona_cat']['show_cat_title']) : sanitize_key(barcelona_get_option('show_cat_title__category'));
        $barcelona_meta['add_header_ad'] = sanitize_key($_POST['barcelona_cat']['add_header_ad']);
        // We trust the author here. The author can add html ad code.
        $barcelona_meta['header_ad_1'] = isset($_POST['barcelona_cat']['header_ad_1']) ? stripcslashes($_POST['barcelona_cat']['header_ad_1']) : '';
        $barcelona_meta['header_ad_2'] = isset($_POST['barcelona_cat']['header_ad_2']) ? stripcslashes($_POST['barcelona_cat']['header_ad_2']) : '';
        $barcelona_meta['set_background'] = $_POST['barcelona_cat']['set_background'] == 'custom' ? 'custom' : 'inherit';
        $barcelona_meta['background']['background-color'] = isset($_POST['barcelona_cat']['background_color']) ? sanitize_text_field($_POST['barcelona_cat']['background_color']) : '';
        $barcelona_meta['background']['background-repeat'] = isset($_POST['barcelona_cat']['background_repeat']) ? sanitize_key($_POST['barcelona_cat']['background_repeat']) : '';
        $barcelona_meta['background']['background-position'] = isset($_POST['barcelona_cat']['background_position']) ? sanitize_text_field($_POST['barcelona_cat']['background_position']) : '';
        $barcelona_meta['background']['background-attachment'] = isset($_POST['barcelona_cat']['background_attachment']) ? sanitize_key($_POST['barcelona_cat']['background_attachment']) : '';
        $barcelona_meta['background']['background-size'] = isset($_POST['barcelona_cat']['background_size']) ? sanitize_text_field($_POST['barcelona_cat']['background_size']) : '';
        $barcelona_meta['background']['background-image'] = isset($_POST['barcelona_cat']['background_image']) ? esc_url_raw($_POST['barcelona_cat']['background_image']) : '';
        update_option('_barcelona_category_' . $term_id, $barcelona_meta);
    }
}