Example #1
0
function add_custom_taxonomies()
{
    // POST TYPE  GALLERY
    register_taxonomy('ct_gallery', 'gallery', array('hierarchical' => true, 'labels' => array('name' => _x('Gallery Categories', 'taxonomy general name', tk_theme_name()), 'singular_name' => _x('Gallery Categories', 'taxonomy singular name', tk_theme_name()), 'search_items' => __('Search Gallery Categories', tk_theme_name()), 'all_items' => __('All Gallery Categories', tk_theme_name()), 'parent_item' => __('Parent Gallery Category', tk_theme_name()), 'parent_item_colon' => __('Parent Gallery Category', tk_theme_name()), 'edit_item' => __('Edit Gallery Category', tk_theme_name()), 'update_item' => __('Update Gallery Category', tk_theme_name()), 'add_new_item' => __('Add New Gallery Category', tk_theme_name()), 'new_item_name' => __('New Gallery Category', tk_theme_name()), 'menu_name' => __('Gallery Categories', tk_theme_name())), 'rewrite' => array('slug' => 'gallery-category', 'with_front' => false, 'hierarchical' => true)));
    // POST TYPE MEMBERS
    register_taxonomy('ct_members', 'team-members', array('hierarchical' => true, 'labels' => array('name' => _x('Team Member Categories', 'taxonomy general name', tk_theme_name()), 'singular_name' => _x('Team Members Categories', 'taxonomy singular name', tk_theme_name()), 'search_items' => __('Search Team Members Categories', tk_theme_name()), 'all_items' => __('All Team Members Categories', tk_theme_name()), 'parent_item' => __('Parent Team Members Category', tk_theme_name()), 'parent_item_colon' => __('Parent Team Members Category', tk_theme_name()), 'edit_item' => __('Edit Team Members Category', tk_theme_name()), 'update_item' => __('Update Team Members Category', tk_theme_name()), 'add_new_item' => __('Add New Team Members Category', tk_theme_name()), 'new_item_name' => __('New Team Members Category', tk_theme_name()), 'menu_name' => __('Team Members Categories', tk_theme_name())), 'rewrite' => array('slug' => 'team-category', 'with_front' => false, 'hierarchical' => true)));
    // POST TYPE  SERVICES
    register_taxonomy('ct_eventos', 'eventos', array('hierarchical' => true, 'labels' => array('name' => _x('Categoria de evento', 'taxonomy general name', tk_theme_name()), 'singular_name' => _x('Categoria de Eventos', 'taxonomy singular name', tk_theme_name()), 'search_items' => __('Search Services Categories', tk_theme_name()), 'all_items' => __('All Services Categories', tk_theme_name()), 'parent_item' => __('Parent Service Category', tk_theme_name()), 'parent_item_colon' => __('Parent Service Category', tk_theme_name()), 'edit_item' => __('Edit Service Category', tk_theme_name()), 'update_item' => __('Update Services Category', tk_theme_name()), 'add_new_item' => __('Añadir nuevo categoría de evento', tk_theme_name()), 'new_item_name' => __('Nueva categoría de evento', tk_theme_name()), 'menu_name' => __('Categoria de Eventos', tk_theme_name())), 'rewrite' => array('slug' => 'cteventos', 'with_front' => false, 'hierarchical' => true)));
}
function add_custom_taxonomies()
{
    // POST TYPE POST, SPEAKERS
    register_taxonomy('ct_portfolio', 'pt_portfolio', array('hierarchical' => true, 'labels' => array('name' => _x('Portfolio Categories', 'taxonomy general name', tk_theme_name()), 'singular_name' => _x('Portfolio Categories', 'taxonomy singular name', tk_theme_name()), 'search_items' => __('Search Portfolio Categories', tk_theme_name()), 'all_items' => __('All Portfolio Categories', tk_theme_name()), 'parent_item' => __('Parent Portfolio Category', tk_theme_name()), 'parent_item_colon' => __('Parent Portfolio Category', tk_theme_name()), 'edit_item' => __('Edit Portfolio Category', tk_theme_name()), 'update_item' => __('Update Portfolio Category', tk_theme_name()), 'add_new_item' => __('Add New Portfolio Categories', tk_theme_name()), 'new_item_name' => __('New Portfolio Category', tk_theme_name()), 'menu_name' => __('Portfolio Categories', tk_theme_name())), 'rewrite' => array('slug' => 'locations', 'with_front' => false, 'hierarchical' => true)));
}
<?php

//require_once (TEMPLATEPATH.'/functions.php');
$prefix = 'tk_';
$meta_boxes = array(array('id' => 'post_meta1', 'title' => __('Video Link', tk_theme_name()), 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Video Link', tk_theme_name()), 'desc' => '', 'id' => $prefix . 'video_link', 'type' => 'text', 'std' => ''))), array('id' => 'post_meta2', 'title' => __('Slider Images', tk_theme_name()), 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => 'Slider', 'desc' => '', 'id' => $prefix . 'repeatable', 'type' => 'repeatable'))), array('id' => 'post_meta3', 'title' => __('Page Headline', tk_theme_name()), 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => 'Page Headline', 'desc' => '', 'id' => 'page_headline', 'type' => 'text', 'name' => 'Page Headline', 'value' => '', 'std' => ''), array('label' => 'Page Headline', 'desc' => '', 'id' => 'page_headline_link', 'type' => 'text', 'name' => 'Page Headline Link', 'value' => '', 'std' => ''))));
foreach ($meta_boxes as $meta_box) {
    $my_box = new My_meta_box($meta_box);
}
class My_meta_box
{
    protected $_meta_box;
    // create meta box based on given data
    function __construct($meta_box)
    {
        $this->_meta_box = $meta_box;
        add_action('admin_menu', array(&$this, 'add'));
        add_action('save_post', array(&$this, 'save'));
    }
    /// Add meta box for multiple post types
    function add()
    {
        foreach ($this->_meta_box['pages'] as $page) {
            add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);
        }
    }
    // Callback function to show fields in meta box
    function show()
    {
        global $post;
        // Use nonce for verification
        echo '<input type="hidden" name="tk_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
<?php

$args = array('orderby' => 'name', 'hide_empty' => 1, 'depth' => 10);
$categories = get_categories($args);
$new_array = array();
foreach ($categories as $category_list) {
    $array_to_add = array('id' => 'cat_' . $category_list->term_id, 'name' => 'cat_' . $category_list->term_id, 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array(''), 'label' => $category_list->cat_name, 'desc' => '');
    array_push($new_array, $array_to_add);
}
$tabs = array(array('pg' => array('slug' => 'theme-settings', 'menu_title' => 'Theme Settings', 'page_title' => 'Theme Settings'), 'id' => 'general', 'name' => 'General Options', 'fields' => array(array('id' => 'header_logo', 'name' => 'header_logo', 'type' => 'file', 'value' => get_template_directory_uri() . "/style/img/logo.png", 'label' => 'Header Logo', 'desc' => 'JPEG, GIF or PNG image, 110x35px recommended, up to 500KB'), array('id' => 'favicon', 'name' => 'favicon', 'type' => 'file', 'value' => get_template_directory_uri() . "/style/img/favicon.ico", 'label' => 'Favicon', 'desc' => 'File format: ICO, dimenstions: 16x16'), array('id' => 'google_analytics', 'name' => 'google_analytics', 'type' => 'textarea', 'value' => '', 'label' => 'Google Analytics code', 'desc' => '', 'options' => array('rows' => '5', 'cols' => '80')), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'footer_copy', 'name' => 'footer_copy', 'type' => 'text', 'value' => 'Copyright Information Goes Here © 2012. All Rights Reserved.', 'label' => 'Footer Copy Text', 'desc' => 'Text which appears in footer as copyright text', 'options' => array('size' => '100')))), array('pg' => array('slug' => 'theme-settings', 'menu_title' => 'Theme Settings', 'page_title' => 'Theme Settings'), 'id' => 'home', 'name' => 'Home Page', 'fields' => array(array('id' => 'use_home_content', 'name' => 'use_home_content', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('Use Home Content'), 'label' => '', 'desc' => ''), array('id' => 'home_content', 'name' => 'home_content', 'type' => 'pages', 'value' => '', 'label' => 'Choose page to use on Home Content:', 'desc' => 'only content from this page will be shown on Home Page.'), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'show_latest_news', 'name' => 'show_latest_news', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('If checked latest news will be shown.'), 'label' => 'Show Latest News', 'desc' => ''), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'use_call_to_action', 'name' => 'use_call_to_action', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('Use Call To Action'), 'label' => '', 'desc' => ''), array('id' => 'call_to_action_text', 'name' => 'call_to_action_text', 'type' => 'textarea', 'value' => '', 'label' => 'Call To Action Text', 'desc' => 'Insert Text for Call To Action part of Home Page.', 'options' => array('rows' => '5', 'cols' => '101')), array('id' => 'call_to_action_button_text', 'name' => 'call_to_action_button_text', 'type' => 'text', 'value' => '', 'label' => 'Call To Action Button Text', 'desc' => 'Insert Text for Button in Call To Action part of Home Page.', 'options' => array('size' => '20')), array('id' => 'call_to_action_button_url', 'name' => 'call_to_action_button_url', 'type' => 'text', 'value' => '', 'label' => 'Call To Action URL', 'desc' => 'Insert Url for Button in Call To Action part of Home Page ( http://www.themeskingdom.com ).', 'options' => array('size' => '100')))), array('pg' => array('slug' => 'theme-settings', 'menu_title' => 'Theme Settings', 'page_title' => 'Theme Settings'), 'id' => 'social', 'name' => 'Social', 'fields' => array(array('id' => 'enable_rss', 'name' => 'enable_rss', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('Enable RSS'), 'label' => 'RSS', 'desc' => 'Enable RSS Feed'), array('id' => 'show_twitter', 'name' => 'show_twitter', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('If checked twitter field be shown above widgets'), 'label' => 'Show Twitter', 'desc' => ''), array('id' => 'rss_url', 'name' => 'rss_url', 'type' => 'text', 'value' => '', 'label' => 'RSS Feed URL', 'desc' => 'If empty, default WordPress url will be used', 'options' => array('size' => '80')), array('id' => 'google_plus', 'name' => 'google_plus', 'type' => 'text', 'value' => '', 'label' => 'Google Plus account', 'desc' => 'Enter Google+ account (e.g. 123456789012345678901) or leave empty if you dont wish to use Google+', 'options' => array('size' => '80')), array('id' => 'facebook', 'name' => 'facebook', 'type' => 'text', 'value' => '', 'label' => 'Facebook account', 'desc' => 'Enter Facebook account (e.g. themeskingdom) or leave empty if you dont wish to use Facebook', 'options' => array('size' => '80')), array('id' => 'twitter', 'name' => 'twitter', 'type' => 'text', 'value' => '', 'label' => 'Twitter account', 'desc' => 'Enter Twitter account (e.g. themeskingdom) or leave empty if you dont wish to use Twitter', 'options' => array('size' => '80')), array('id' => 'linked_in', 'name' => 'linked_in', 'type' => 'text', 'value' => '', 'label' => 'Linkedin account', 'desc' => 'Enter Linkedin account (e.g. http://www.linkedin.com/company/2687325) or leave empty if you dont wish to use Linkedin', 'options' => array('size' => '80')), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'twitter_auth', 'name' => 'twitter_auth', 'type' => 'label', 'value' => '', 'label' => '<a target="_blank" href="http://www.themeskingdom.com/knowledge-base/how-to-setup-twitter/">How to setup Twitter authentication</a> '), array('id' => 'twitter_consumer_key', 'name' => 'twitter_consumer_key', 'type' => 'text', 'value' => '', 'label' => 'Consumer key', 'desc' => 'Application consumer key', 'options' => array('size' => '80')), array('id' => 'twitter_consumer_secret', 'name' => 'twitter_consumer_secret', 'type' => 'text', 'value' => '', 'label' => 'Consumer secret', 'desc' => 'Application consumer secret', 'options' => array('size' => '80')), array('id' => 'twitter_access_token', 'name' => 'twitter_access_token', 'type' => 'text', 'value' => '', 'label' => 'Access token', 'desc' => 'Application access token', 'options' => array('size' => '80')), array('id' => 'twitter_token_secret', 'name' => 'twitter_token_secret', 'type' => 'text', 'value' => '', 'label' => 'Access Token Secret', 'desc' => 'Application access token secret', 'options' => array('size' => '80')))), array('pg' => array('slug' => 'theme-settings', 'menu_title' => 'Theme Settings', 'page_title' => 'Theme Settings'), 'id' => 'contact', 'name' => 'Contact', 'fields' => array(array('id' => 'show_map', 'name' => 'show_map', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('If checked map will be shown'), 'label' => 'Show Map', 'desc' => ''), array('id' => 'contact_text', 'name' => 'contact_text', 'type' => 'textarea', 'value' => '', 'label' => 'Text on the side of contact form', 'desc' => 'Enter the text you want to show on contact form page besides form.', 'options' => array('rows' => '5', 'cols' => '80')), array('id' => 'contact_subject', 'name' => 'contact_subject', 'type' => 'text', 'value' => 'E-mail from ' . tk_theme_name() . ' Theme', 'label' => 'Subject for your contact form', 'desc' => 'This will be subject when you receive e-mail from your site', 'options' => array('size' => '100')), array('id' => 'name_error_message', 'name' => 'name_error_message', 'type' => 'text', 'value' => 'Please insert your name!', 'label' => 'Name error message', 'desc' => 'Enter error message if name is not entered in contact form', 'options' => array('size' => '100')), array('id' => 'email_error_message', 'name' => 'email_error_message', 'type' => 'text', 'value' => 'Please insert your e-mail!', 'label' => 'E-mail error message', 'desc' => 'Enter error message if e-mail is not entered in contact form', 'options' => array('size' => '100')), array('id' => 'message_error_message', 'name' => 'message_error_message', 'type' => 'text', 'value' => 'Please insert your message!', 'label' => 'Message text error message', 'desc' => 'Enter error message if message text is not entered in contact form', 'options' => array('size' => '100')), array('id' => 'message_successful', 'name' => 'message_successful', 'type' => 'text', 'value' => 'Message sent!', 'label' => 'Message on successful e-mail send', 'desc' => 'Enter notification text for successfully sent message', 'options' => array('size' => '100')), array('id' => 'message_unsuccessful', 'name' => 'message_unsuccessful', 'type' => 'text', 'value' => 'Some error occured!', 'label' => 'Message for error on e-mail send', 'desc' => 'Enter notification text for unsuccessfully sent message', 'options' => array('size' => '100')), array('id' => 'googlemap_x', 'name' => 'googlemap_x', 'type' => 'text', 'value' => '', 'label' => 'Google map X coordinate', 'desc' => 'Insert google map coordinate for your adress', 'options' => array('size' => '5')), array('id' => 'googlemap_y', 'name' => 'googlemap_y', 'type' => 'text', 'value' => '', 'label' => 'Google map Y coordinate', 'desc' => 'Insert google map coordinate for your adress', 'options' => array('size' => '5')), array('id' => 'googlemap_zoom', 'name' => 'googlemap_zoom', 'type' => 'text', 'value' => '15', 'label' => 'Google map zoom factor', 'desc' => 'Insert google map zoom factor', 'options' => array('size' => '5')), array('id' => 'marker_title', 'name' => 'marker_title', 'type' => 'text', 'value' => 'Marker', 'label' => 'Marker Title', 'desc' => 'Insert marker title.', 'options' => array('size' => '100')), array('id' => 'google_map_type', 'name' => 'google_map_type', 'type' => 'select', 'value' => array(array('HYBRID', 'HYBRID'), array('ROADMAP', 'ROADMAP'), array('SATELLITE', 'SATELLITE'), array('TERRAIN', 'TERRAIN')), 'label' => 'Google Map type', 'desc' => 'Select map type you want to use.'))));
Example #5
0
<?php

//require_once (TEMPLATEPATH.'/functions.php');
$prefix = 'tk_';
//$tk_theme_name = get_option('tk_theme_name');
//define('tk_theme_name',get_option('tk_theme_name'));
$meta_boxes = array(array('id' => 'post_meta1', 'title' => __('Post Views', tk_theme_name()), 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Post Views', tk_theme_name()), 'desc' => '', 'id' => $prefix . 'views', 'type' => 'text', 'std' => ''))), array('id' => 'post_meta2', 'title' => __('Page Custom Color', tk_theme_name()), 'pages' => array('page'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Page Custom Color', tk_theme_name()), 'desc' => 'Chose Color for Title section for this page', 'id' => $prefix . 'color', 'type' => 'colorpicker', 'std' => '5F5F5F'))));
foreach ($meta_boxes as $meta_box) {
    $my_box = new My_meta_box($meta_box);
}
class My_meta_box
{
    protected $_meta_box;
    // create meta box based on given data
    function __construct($meta_box)
    {
        $this->_meta_box = $meta_box;
        add_action('admin_menu', array(&$this, 'add'));
        add_action('save_post', array(&$this, 'save'));
    }
    /// Add meta box for multiple post types
    function add()
    {
        foreach ($this->_meta_box['pages'] as $page) {
            add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);
        }
    }
    // Callback function to show fields in meta box
    function show()
    {
        global $post;
Example #6
0
function gplus_count()
{
    $google_plus_count = '';
    $gplus_username = get_theme_option(tk_theme_name() . '_social_google_plus');
    $gplus_api = get_theme_option(tk_theme_name() . '_social_google_plus_api');
    $get_link = wp_remote_get("https://www.googleapis.com/plus/v1/people/" . $gplus_username . "?key=" . $gplus_api, array('timeout' => 30));
    if (is_wp_error($get_link)) {
        return "0.";
    } else {
        $google_plus_count = json_decode($get_link['body'], true);
        return intval($google_plus_count['plusOneCount']);
    }
}
Example #7
0
<?php

$args = array('orderby' => 'name', 'hide_empty' => 1, 'depth' => 10);
$categories = get_categories($args);
$new_array = array();
foreach ($categories as $category_list) {
    $array_to_add = array('id' => 'cat_' . $category_list->term_id, 'name' => 'cat_' . $category_list->term_id, 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array(''), 'label' => $category_list->cat_name, 'desc' => '');
    array_push($new_array, $array_to_add);
}
$tabs = array(array('pg' => array('slug' => 'theme-settings', 'menu_title' => 'Theme Settings', 'page_title' => 'Theme Settings'), 'id' => 'general', 'name' => 'General Options', 'fields' => array(array('id' => 'header_logo', 'name' => 'header_logo', 'type' => 'file', 'value' => get_template_directory_uri() . "/style/img/logo.png", 'label' => 'Header Logo', 'desc' => 'JPEG, GIF or PNG image, 216×28 recommended up to 500KB'), array('id' => 'footer_logo', 'name' => 'footer_logo', 'type' => 'file', 'value' => get_template_directory_uri() . "/style/img/footer-logo.png", 'label' => 'Footer Logo', 'desc' => 'JPEG, GIF or PNG image, 135x18px recommended, up to 500KB'), array('id' => 'favicon', 'name' => 'favicon', 'type' => 'file', 'value' => get_template_directory_uri() . "/style/img/favicon.ico", 'label' => 'Favicon', 'desc' => 'File format: ICO, dimenstions: 16x16'), array('id' => 'google_analytics', 'name' => 'google_analytics', 'type' => 'textarea', 'value' => '', 'label' => 'Google Analytics code', 'desc' => '', 'options' => array('rows' => '5', 'cols' => '80')), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'header_telephone', 'name' => 'header_telephone', 'type' => 'text', 'value' => '', 'label' => 'Header Telephone Number', 'desc' => 'Text which appears in header section, it will appear with telephone icon.', 'options' => array('size' => '100')), array('id' => 'header_email', 'name' => 'header_email', 'type' => 'text', 'value' => '', 'label' => 'Header E-Mail', 'desc' => 'Text which appears in header section, it will appear with envelope icon.', 'options' => array('size' => '100')), array('id' => 'header_address', 'name' => 'header_address', 'type' => 'text', 'value' => '', 'label' => 'Header Address', 'desc' => 'Text which appears in header section, it will appear with marker icon.', 'options' => array('size' => '100')), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'custom_sidebars', 'name' => 'custom_sidebars', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('Use different sidebars on page templates.'), 'label' => 'Custom Sidebars', 'desc' => 'Check this box if you want to use custom sidebars on page templates, if unchecked the default sidebar will be used on every page.'), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'footer_copy', 'name' => 'footer_copy', 'type' => 'text', 'value' => 'Copyright Information Goes Here © 2012. All Rights Reserved.', 'label' => 'Footer Copy Text', 'desc' => 'Text which appears in footer as copyright text', 'options' => array('size' => '100')))), array('pg' => array('slug' => 'theme-settings', 'menu_title' => 'Theme Settings', 'page_title' => 'Theme Settings'), 'id' => 'home', 'name' => 'Home Page', 'fields' => array(array('id' => 'enable_slider', 'name' => 'enable_slider', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('Enable Home Page Revolution Slider'), 'label' => '', 'desc' => ''), array('id' => 'slider_id', 'name' => 'slider_id', 'type' => 'text', 'value' => '', 'label' => 'Slider ID or ALIAS', 'desc' => 'When you configure your Revolution Slider from Revolution Panel, insert here ID or ALIAS you received there.', 'options' => array('size' => '20')), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'enable_team', 'name' => 'enable_team', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('If checked "Our Team" section will be disabled'), 'label' => 'Disable "Our Team" section', 'desc' => ''), array('id' => 'team_text', 'name' => 'team_text', 'type' => 'text', 'value' => '', 'label' => 'Text for Our Team section', 'desc' => 'Write text for Our Team section on home page/ ', 'options' => array('size' => '100')), array('id' => 'members_number', 'name' => 'members_number', 'type' => 'select', 'value' => array(array('4', '4'), array('8', '8'), array('12', '12'), array('16', '16')), 'label' => 'Number of "Members" Posts', 'desc' => 'Set how many "Members" posts will be shown on the home page'), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'latest_news', 'name' => 'latest_news', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('If checked "Latest News" section will be disabled'), 'label' => 'Disable "Latest News" section', 'desc' => ''), array('id' => 'news_number_home', 'name' => 'news_number_home', 'type' => 'select', 'value' => array(array('1', '1'), array('2', '2'), array('3', '3'), array('4', '4'), array('5', '5'), array('6', '6'), array('7', '7'), array('8', '8'), array('9', '9'), array('10', '10'), array('11', '11'), array('12', '12'), array('13', '13'), array('14', '14'), array('15', '15'), array('16', '16')), 'label' => 'Number of Latest News', 'desc' => 'Set how many Latest News will be shown on the home page'), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'enable_services', 'name' => 'enable_services', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('If checked "Services" section will be disabled'), 'label' => 'Disable "Services" section', 'desc' => ''), array('id' => 'services_number', 'name' => 'services_number', 'type' => 'select', 'value' => array(array('1', '1'), array('2', '2'), array('3', '3'), array('4', '4'), array('5', '5'), array('6', '6'), array('7', '7'), array('8', '8'), array('9', '9'), array('10', '10'), array('11', '11'), array('12', '12'), array('13', '13'), array('14', '14'), array('15', '15'), array('16', '16')), 'label' => 'Number of "Services" posts', 'desc' => 'Set how many "Services" posts will be shown on the home page'), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'disable_call_to_action', 'name' => 'disable_call_to_action', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('Disable Call To Action'), 'label' => '', 'desc' => ''), array('id' => 'call_to_action_text', 'name' => 'call_to_action_text', 'type' => 'textarea', 'value' => '', 'label' => 'Call To Action Text', 'desc' => 'Insert Text for Call To Action part of Home Page.', 'options' => array('rows' => '5', 'cols' => '101')), array('id' => 'call_to_action_button_text', 'name' => 'call_to_action_button_text', 'type' => 'text', 'value' => '', 'label' => 'Call To Action Button Text', 'desc' => 'Insert Text for Button in Call To Action part of Home Page.', 'options' => array('size' => '20')), array('id' => 'call_to_action_button_url', 'name' => 'call_to_action_button_url', 'type' => 'text', 'value' => '', 'label' => 'Call To Action URL', 'desc' => 'Insert Url for Button in Call To Action part of Home Page ( http://www.themeskingdom.com ).', 'options' => array('size' => '100')), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'use_home_content', 'name' => 'use_home_content', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('Use Home Content'), 'label' => '', 'desc' => ''), array('id' => 'home_content', 'name' => 'home_content', 'type' => 'pages', 'value' => '', 'label' => 'Chose page to use on Home Content:', 'desc' => 'only content from this page will be shown on Home Page.'))), array('pg' => array('slug' => 'theme-settings', 'menu_title' => 'Theme Settings', 'page_title' => 'Theme Settings'), 'id' => 'gallery', 'name' => 'Filter Options', 'fields' => array(array('id' => 'gallery_orderby', 'name' => 'gallery_orderby', 'type' => 'select', 'value' => array(array('Sort by Number of Items in Category', 'count'), array('Sort by SLUG (Alphabetically)', 'slug'), array('Sort by Category ID', 'term_id')), 'label' => 'Reorder Categories in Gallery/Services/Team Members Filter', 'desc' => 'Select how to sort categories in gallery/services/team members Filter.'), array('id' => 'gallery_order', 'name' => 'gallery_order', 'type' => 'select', 'value' => array(array('Sort Ascending', 'ASC'), array('Sort Descending', 'DESC')), 'label' => 'Sort Categories in Gallery/Services/Team Members Filter Ascending or Descending', 'desc' => 'Select how to sort categories in gallery/services/team members Filter.'), array('id' => 'box_1_hr', 'name' => 'box_1_hr', 'type' => 'hr', 'options' => array('width' => '100%', 'color' => '#DFDFDF')), array('id' => 'gallery_single', 'name' => 'gallery_single', 'type' => 'select', 'value' => array(array('Enable Single Post', 'yes'), array('Disable Single Post', 'no')), 'label' => 'Enable / Disable Single Post', 'desc' => 'Select to enable or disable single post for Gallery/Members/Team Members Page. '))), array('pg' => array('slug' => 'theme-settings', 'menu_title' => 'Theme Settings', 'page_title' => 'Theme Settings'), 'id' => 'social', 'name' => 'Social', 'fields' => array(array('id' => 'rss_url', 'name' => 'rss_url', 'type' => 'text', 'value' => '', 'label' => 'RSS Feed URL', 'desc' => 'Enter url of RSS feed you want to use. WordPress default is www.yoursite.com/feed/.', 'options' => array('size' => '80')), array('id' => 'google_plus', 'name' => 'google_plus', 'type' => 'text', 'value' => '', 'label' => 'Google Plus account', 'desc' => 'Enter Google+ account (e.g. 123456789012345678901) or leave empty if you dont wish to use Google+', 'options' => array('size' => '80')), array('id' => 'facebook', 'name' => 'facebook', 'type' => 'text', 'value' => '', 'label' => 'Facebook account', 'desc' => 'Enter Facebook account (e.g. themeskingdom) or leave empty if you dont wish to use Facebook', 'options' => array('size' => '80')), array('id' => 'twitter', 'name' => 'twitter', 'type' => 'text', 'value' => '', 'label' => 'Twitter account', 'desc' => 'Enter Twitter account (e.g. themeskingdom) or leave empty if you dont wish to use Twitter', 'options' => array('size' => '80')), array('id' => 'linkedin', 'name' => 'linkedin', 'type' => 'text', 'value' => '', 'label' => 'Linkedin account', 'desc' => 'Enter Linkedin account (e.g. http://www.linkedin.com/company/2687325) or leave empty if you dont wish to use Linkedin', 'options' => array('size' => '80')), array('id' => 'pinterest', 'name' => 'pinterest', 'type' => 'text', 'value' => '', 'label' => 'Pinterest account', 'desc' => 'Enter Pinterest account (e.g. themeskingdom) or leave empty if you dont wish to use Pinterest', 'options' => array('size' => '80')))), array('pg' => array('slug' => 'theme-settings', 'menu_title' => 'Theme Settings', 'page_title' => 'Theme Settings'), 'id' => 'contact', 'name' => 'Contact', 'fields' => array(array('id' => 'contact_subject', 'name' => 'contact_subject', 'type' => 'text', 'value' => 'E-mail from ' . tk_theme_name() . ' Theme', 'label' => 'Subject for your contact form', 'desc' => 'This will be subject when you receive e-mail from your site', 'options' => array('size' => '100')), array('id' => 'name_error_message', 'name' => 'name_error_message', 'type' => 'text', 'value' => 'Please insert your name!', 'label' => 'Name error message', 'desc' => 'Enter error message if name is not entered in contact form', 'options' => array('size' => '100')), array('id' => 'email_error_message', 'name' => 'email_error_message', 'type' => 'text', 'value' => 'Please insert your e-mail!', 'label' => 'E-mail error message', 'desc' => 'Enter error message if e-mail is not entered in contact form', 'options' => array('size' => '100')), array('id' => 'message_error_message', 'name' => 'message_error_message', 'type' => 'text', 'value' => 'Please insert your message!', 'label' => 'Message text error message', 'desc' => 'Enter error message if message text is not entered in contact form', 'options' => array('size' => '100')), array('id' => 'phone_error', 'name' => 'phone_error', 'type' => 'text', 'value' => 'Please insert your phone number!', 'label' => 'Phone error message', 'desc' => 'Enter error message if phone number is not entered in appointment form', 'options' => array('size' => '100')), array('id' => 'date_error', 'name' => 'date_error', 'type' => 'text', 'value' => 'Please insert your appointment date!', 'label' => 'Date error message', 'desc' => 'Enter error message if appointment date is not entered in appointment form', 'options' => array('size' => '100')), array('id' => 'doctor_error', 'name' => 'doctor_error', 'type' => 'text', 'value' => 'Please Choose the Doctor!', 'label' => 'Doctor error message', 'desc' => 'Enter error message if doctor is not selected in appointment form', 'options' => array('size' => '100')), array('id' => 'message_successful', 'name' => 'message_successful', 'type' => 'text', 'value' => 'Message sent!', 'label' => 'Message on successful e-mail send', 'desc' => 'Enter notification text for successfully sent message', 'options' => array('size' => '100')), array('id' => 'message_unsuccessful', 'name' => 'message_unsuccessful', 'type' => 'text', 'value' => 'Some error occured!', 'label' => 'Message for error on e-mail send', 'desc' => 'Enter notification text for unsuccessfully sent message', 'options' => array('size' => '100')), array('id' => 'show_map', 'name' => 'show_map', 'type' => 'checkbox', 'value' => array('yes'), 'caption' => array('If checked map will be removed'), 'label' => 'Remove  Map', 'desc' => ''), array('id' => 'googlemap_x', 'name' => 'googlemap_x', 'type' => 'text', 'value' => '', 'label' => 'Google map X coordinate', 'desc' => 'Insert google map coordinate for your adress', 'options' => array('size' => '5')), array('id' => 'googlemap_y', 'name' => 'googlemap_y', 'type' => 'text', 'value' => '', 'label' => 'Google map Y coordinate', 'desc' => 'Insert google map coordinate for your adress', 'options' => array('size' => '5')), array('id' => 'googlemap_zoom', 'name' => 'googlemap_zoom', 'type' => 'text', 'value' => '15', 'label' => 'Google map zoom factor', 'desc' => 'Insert google map zoom factor', 'options' => array('size' => '5')), array('id' => 'marker_title', 'name' => 'marker_title', 'type' => 'text', 'value' => 'Marker', 'label' => 'Marker Title', 'desc' => 'Insert marker title.', 'options' => array('size' => '100')), array('id' => 'google_map_type', 'name' => 'google_map_type', 'type' => 'select', 'value' => array(array('HYBRID', 'HYBRID'), array('ROADMAP', 'ROADMAP'), array('SATELLITE', 'SATELLITE'), array('TERRAIN', 'TERRAIN')), 'label' => 'Google Map type', 'desc' => 'Select map type you want to use.'))));
Example #8
0
<?php

//require_once (TEMPLATEPATH.'/functions.php');
$prefix = 'tk_';
$meta_boxes = array(array('id' => 'post_meta1', 'title' => __('VIdeo Link', tk_theme_name()), 'pages' => array('post', 'gallery'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Video Link', tk_theme_name()), 'desc' => '', 'id' => $prefix . 'video_link', 'type' => 'text', 'std' => ''))), array('id' => 'post_meta2', 'title' => __('Slider Fields', tk_theme_name()), 'pages' => array('post', 'gallery'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('label' => 'Repeatable', 'name' => 'repeatable', 'desc' => '', 'id' => $prefix . 'repeatable', 'type' => 'repeatable'))), array('id' => 'post_meta3', 'title' => __('Audio Link', tk_theme_name()), 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Audio Link', tk_theme_name()), 'desc' => '', 'id' => $prefix . 'audio_link', 'type' => 'text', 'std' => ''))), array('id' => 'post_meta4', 'title' => __('Quote Text', tk_theme_name()), 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Quote Text', tk_theme_name()), 'desc' => '', 'id' => $prefix . 'quote', 'type' => 'text', 'std' => ''), array('name' => __('Quote Author', tk_theme_name()), 'desc' => '', 'id' => $prefix . 'quote_author', 'type' => 'text', 'std' => ''))), array('id' => 'post_meta5', 'title' => __('Link', tk_theme_name()), 'pages' => array('post'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Link Text', tk_theme_name()), 'desc' => '', 'id' => $prefix . 'link_text', 'type' => 'text', 'std' => ''), array('name' => __('Link Url', tk_theme_name()), 'desc' => '', 'id' => $prefix . 'link_url', 'type' => 'text', 'std' => ''))), array('id' => 'post_meta7', 'title' => __('Event Date', tk_theme_name()), 'pages' => array('events'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Date Of Event', tk_theme_name()), 'desc' => '', 'id' => $prefix . 'event_date', 'type' => 'datepicker', 'std' => ''))), array('id' => 'post_meta8', 'title' => __('Testimonial', tk_theme_name()), 'pages' => array('testimonials'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Job Position', tk_theme_name()), 'desc' => '', 'id' => $prefix . 'name', 'type' => 'text', 'std' => ''), array('name' => __('E-mail', tk_theme_name()), 'desc' => '', 'id' => $prefix . 'email', 'type' => 'text', 'std' => ''))), array('id' => 'post_meta9', 'title' => __('Información el Evento', tk_theme_name()), 'pages' => array('eventos'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Fecha del evento', tk_theme_name()), 'desc' => 'Esta valor aparecerá publica en la pagina principal.', 'id' => $prefix . 'event_date', 'type' => 'text', 'std' => ''), array('name' => __('Hora del evento', tk_theme_name()), 'desc' => 'Esta valor aparece públicada en la pagina principal.', 'id' => $prefix . 'event_hour', 'type' => 'text', 'std' => ''), array('name' => __('Lugar del evento', tk_theme_name()), 'desc' => 'Esta valor aparece públicada en la pagina principal.', 'id' => $prefix . 'event_info', 'type' => 'text', 'std' => ''))), array('id' => 'post_meta10', 'title' => __('Member Info', tk_theme_name()), 'pages' => array('team-members'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Team Member Title', tk_theme_name()), 'desc' => 'Set title for team member, it will be shown on home page.', 'id' => $prefix . 'title_info', 'type' => 'text', 'std' => ''), array('name' => __('Facebook Account', tk_theme_name()), 'desc' => 'Enter Facebook account (e.g. themeskingdom) or leave empty if you dont wish to use Facebook', 'id' => $prefix . 'facebook_info', 'type' => 'text', 'std' => ''), array('name' => __('Twitter account', tk_theme_name()), 'desc' => 'Enter Twitter account (e.g. themeskingdom) or leave empty if you dont wish to use Twitter', 'id' => $prefix . 'twitter_info', 'type' => 'text', 'std' => ''), array('name' => __('Linkedin account', tk_theme_name()), 'desc' => 'Enter Linkedin account (e.g. http://www.linkedin.com/company/2687325) or leave empty if you dont wish to use Linkedin', 'id' => $prefix . 'linkedin_info', 'type' => 'text', 'std' => ''), array('name' => __('Google+ Account', tk_theme_name()), 'desc' => 'Enter Google+ account (e.g. 123456789012345678901) or leave empty if you dont wish to use Google+', 'id' => $prefix . 'google_info', 'type' => 'text', 'std' => ''), array('name' => __('E-Mail', tk_theme_name()), 'desc' => 'Enter the e-mail of the memeber or leave it empty if you do not wish to display e-mail.', 'id' => $prefix . 'email_info', 'type' => 'text', 'std' => ''))), array('id' => 'post_meta11', 'title' => __('Headline Text', tk_theme_name()), 'pages' => array('page', 'post', 'team-members', 'gallery', 'services'), 'context' => 'normal', 'priority' => 'high', 'fields' => array(array('name' => __('Page Headline', tk_theme_name()), 'desc' => 'Set page headline for text.', 'id' => $prefix . 'page_headline', 'type' => 'text', 'std' => ''), array('name' => __('Page Headline Link', tk_theme_name()), 'desc' => 'Set page headline link.', 'id' => $prefix . 'page_headline_link', 'type' => 'text', 'std' => ''))));
foreach ($meta_boxes as $meta_box) {
    $my_box = new My_meta_box($meta_box);
}
class My_meta_box
{
    protected $_meta_box;
    // create meta box based on given data
    function __construct($meta_box)
    {
        $this->_meta_box = $meta_box;
        add_action('admin_menu', array(&$this, 'add'));
        add_action('save_post', array(&$this, 'save'));
    }
    /// Add meta box for multiple post types
    function add()
    {
        foreach ($this->_meta_box['pages'] as $page) {
            add_meta_box($this->_meta_box['id'], $this->_meta_box['title'], array(&$this, 'show'), $page, $this->_meta_box['context'], $this->_meta_box['priority']);
        }
    }
    // Callback function to show fields in meta box
    function show()
    {
        global $post;
        // Use nonce for verification
        echo '<input type="hidden" name="tk_meta_box_nonce" value="', wp_create_nonce(basename(__FILE__)), '" />';
Example #9
0
        get_template_part('home_team-members');
    } elseif ($page_template == '_appointments.php') {
        get_template_part('home_appointments');
    } else {
        get_template_part('home_page');
    }
}
//ends show_home_content
$ourteam = get_theme_option(tk_theme_name . '_home_enable_team');
$ourteam_page_id = get_option('id_ourteam_page');
$ourteam_text = get_option(tk_theme_name . '_home_team_text');
?>

            <?php 
if ($ourteam !== 'yes') {
    $members_num = get_theme_option(tk_theme_name() . '_home_members_number');
    ?>
            
            <div class="meat-our-team-content left">
                <div class="meat-our-team-title left">
                    <span><?php 
    echo get_the_title($ourteam_page_id);
    ?>
</span>
                    <a href="<?php 
    echo get_permalink($ourteam_page_id);
    ?>
"><?php 
    _e('View All', tk_theme_name);
    ?>
<p></p></a>