Exemplo n.º 1
0
/*
Title: Header
Setting: tijara
*/
// Logo
piklist('field', array('type' => 'file', 'field' => 'logo', 'label' => __('Logo', 'tijara'), 'options' => array('button' => __('Upload or choose logo', 'tijara'), 'modal_title' => __('Upload or choose a logo', 'tijara'))));
// Favicon
piklist('field', array('type' => 'file', 'field' => 'favicon', 'help' => __('The recommanded size is 60x60', 'tijara'), 'label' => __('Shortcut Icon (favicon)', 'tijara'), 'options' => array('button' => __('Upload or choose a favicon', 'tijara'), 'modal_title' => __('Upload or choose a favicon', 'tijara'))));
// Logo Position
piklist('field', array('type' => 'radio', 'field' => 'logo_position', 'label' => __('Logo position', 'tijara'), 'choices' => array('' => __('Automatic', 'tijara'), 'header' => __('The header', 'tijara'), 'menu' => __('The primary menu (uses favicon)', 'tijara'), 'none' => __('Hidden', 'tijara')), 'list' => false, 'value' => ''));
// Logo Width
piklist('field', array('type' => 'select', 'field' => 'logo_width', 'label' => 'Logo width (in spans)', 'help' => 'How many header spans (out of 12) will the logo occupy?', 'choices' => array('1' => '1', '2' => '2', '3' => __('3 (1/4th of the header width)', 'tijara'), '4' => __('4 (1/3rd of the header width)', 'tijara'), '6' => __('6 (half the header width)', 'tijara'), '12' => __('12 (the full header)', 'tijara')), 'value' => '3'));
// Top bar menu
piklist('field', array('type' => 'radio', 'field' => 'topbar_menu', 'label' => __('Show top bar menu', 'tijara'), 'choices' => array('1' => __('Yes', 'tijara'), '0' => __('No', 'tijara')), 'list' => false, 'value' => '1'));
// Top bar content
piklist('field', array('type' => 'radio', 'field' => 'topbar_plus', 'value' => tijara_default('topbar_plus'), 'label' => __('Top bar additionnal components', 'tijara'), 'choices' => array('cart' => __('Cart', 'tijara'), 'social' => __('Social icons', 'tijara'), 'cart|social' => __('Cart then social icons', 'tijara'), 'social|cart' => __('Social then cart icons', 'tijara')), 'list' => false));
// Sticky
piklist('field', array('type' => 'checkbox', 'field' => 'sticky', 'label' => __('Enable sticky', 'tijara'), 'choices' => array('topbar' => __('Top bar', 'tijara'), 'menu' => __('Main menu', 'tijara')), 'list' => false, 'value' => 'menu'));
// Responsive, yes or no
piklist('field', array('type' => 'radio', 'field' => 'disable_responsive', 'label' => __('Disable responsive layout', 'tijara'), 'choices' => array('1' => __('Yes', 'tijara'), '0' => __('No', 'tijara')), 'list' => false, 'value' => '0'));
// Boxed
piklist('field', array('type' => 'radio', 'field' => 'boxed', 'label' => __('Use boxed layout', 'tijara'), 'choices' => array('1' => __('Yes', 'tijara'), '0' => __('No', 'tijara')), 'list' => false, 'value' => '0'));
// Main menu width
piklist('field', array('type' => 'radio', 'field' => 'menu_width', 'label' => __('Main menu width', 'tijara'), 'choices' => array('normal' => __('Normal', 'tijara'), 'wide' => __('Wide (fit page)', 'tijara')), 'list' => false, 'value' => 'normal'));
// Boxed > background
piklist('field', array('type' => 'file', 'field' => 'background', 'label' => __('Website background image', 'tijara'), 'options' => array('button' => __('Upload or choose a background image', 'tijara'), 'modal_title' => __('Upload or choose a background image', 'tijara')), 'conditions' => array(array('field' => 'boxed', 'value' => '1'))));
// Boxed > background > style
piklist('field', array('type' => 'select', 'field' => 'background_style', 'label' => __('Background image style', 'tijara'), 'choices' => array('repeat' => __('Repeat', 'tijara'), 'repeat-x' => __('Repeat horizontaly (repeat-x)', 'tijara'), 'repeat-y' => __('Repeat verticaly (repeat-y)', 'tijara'), 'stretch' => __('Stretch', 'tijara')), 'conditions' => array(array('field' => 'boxed', 'value' => '1')), 'value' => 'repeat'));
// Responsive, yes or no
piklist('field', array('type' => 'radio', 'field' => 'sidebar_position', 'label' => __('Sidebar position', 'tijara'), 'choices' => array('before' => __('Before main content', 'tijara'), 'after' => __('After main content', 'tijara')), 'list' => false, 'value' => 'before'));
// Socials links
Exemplo n.º 2
0
<?php

/**
 * Prevent direct access to this file
 */
function_exists('tijara_option') or die;
?>

<?php 
$topbar_plus = tijara_option('topbar_plus', tijara_default('topbar_plus'));
$secondary_menu = wp_nav_menu(array('container' => FALSE, 'depth' => 1, 'echo' => FALSE, 'fallback_cb' => '__return_false', 'menu_class' => '', 'theme_location' => 'secondary_menu'));
?>

<div id="masthead-top">
	<div id="masthead-top-inner">
		<?php 
// Prepare menu width
if (strstr($topbar_plus, 'cart') && strstr($topbar_plus, 'social')) {
    $topbar_menu_width = 6;
} else {
    if (strstr($topbar_plus, 'cart') || strstr($topbar_plus, 'social')) {
        $topbar_menu_width = 9;
    } else {
        $topbar_menu_width = 12;
    }
}
// Show menu
if (!empty($secondary_menu)) {
    echo '<div id="secondary-menu" class="span' . $topbar_menu_width . '">' . $secondary_menu . '</div>';
}
// Show cart and social