当前位置: 首页>>代码示例>>PHP>>正文


PHP thb_theme函数代码示例

本文整理汇总了PHP中thb_theme函数的典型用法代码示例。如果您正苦于以下问题:PHP thb_theme函数的具体用法?PHP thb_theme怎么用?PHP thb_theme使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了thb_theme函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: thb_seo_options_tab

 function thb_seo_options_tab()
 {
     if (thb_is_super_user()) {
         $thb_page = thb_theme()->getAdmin()->getMainPage();
         $thb_tab = new THB_Tab(__('SEO', 'thb_text_domain'), 'seo');
         $thb_container = $thb_tab->createContainer('', 'seo_options');
         $thb_field = new THB_CheckboxField('seo_enable');
         $thb_field->setLabel(__('Enable SEO', 'thb_text_domain'));
         $thb_field->setHelp(__('This option will enable the search engines optimization component. If you mind to use an external plugin, you might want to disable it.', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextField('seo_author');
         $thb_field->setLabel(__('Site author', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextareaField('seo_description');
         $thb_field->setLabel(__('Site description', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextareaField('seo_keywords');
         $thb_field->setLabel(__('Keywords', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextField('seo_robots');
         $thb_field->setLabel(__('Robots', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_TextField('google_site_verification');
         $thb_field->setLabel(__('Google site verification', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_page->addTab($thb_tab);
     }
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:28,代码来源:module.php

示例2: __construct

 /**
  * Constructor
  *
  */
 public function __construct()
 {
     $this->instance = thb_theme();
     $this->instance->getAdmin()->setInstallationDetails(array('updates' => array('last_check' => 0, 'latest_version' => 0, 'changelog' => '')), true);
     // Preserve original data
     $this->checkForUpdates();
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:11,代码来源:class.update.php

示例3: thb_save_option

 function thb_save_option($key, $value)
 {
     $theme = thb_theme();
     $options = $theme->getOptions();
     $options[$key] = $value;
     update_option(THB_OPTIONS_KEY, $options);
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:7,代码来源:helper.options.php

示例4: __construct

 /**
  * Constructor
  *
  * @param string $name The widget name.
  * @param string $label The widget label.
  * @param string $description The widget description.
  * @param string $shortcode The widget shortcode.
  */
 public function __construct($name, $label, $description, $shortcode)
 {
     parent::__construct($name, $label, array('description' => $description));
     $thb_theme = thb_theme();
     $this->_shortcode = $thb_theme->getShortcode($shortcode);
     $this->_description = $description;
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:15,代码来源:class.widget.php

示例5: thb_append_theme_customization

 function thb_append_theme_customization()
 {
     thb_css_start('thb_theme_customization');
     thb_theme()->getCustomization()->render(true);
     // echo get_option(THB_CUSTOMIZATIONS);
     thb_custom_css();
     thb_css_end();
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:8,代码来源:module.php

示例6: thb_add_footerstripe_metabox

 function thb_add_footerstripe_metabox()
 {
     if (thb_is_admin_template(thb_config('footerstripe', 'templates'))) {
         $thb_metabox = thb_theme()->getPostType('page')->getMetabox('layout');
         $thb_container = $thb_metabox->createContainer(__('Footer stripe', 'thb_text_domain'), 'footerstripe_container');
         $thb_field = new THB_SelectField('footerstripe');
         $thb_field->setLabel(__('Select', 'thb_text_domain'));
         $thb_field->setDynamicOptions('thb_get_footerstripes_for_select');
         $thb_container->addField($thb_field);
     }
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:11,代码来源:module.php

示例7: render_content

        /**
         * Render the control.
         *
         * @return void
         */
        public function render_content()
        {
            $thb_theme = thb_theme();
            $fonts = thb_get_fonts();
            ?>
			<label>
				<span class="customize-control-title"><?php 
            echo esc_html($this->label);
            ?>
</span>
				<select <?php 
            $this->link();
            ?>
 class="font-family">
					<?php 
            foreach ($fonts as $style => $families) {
                ?>
						<optgroup label="<?php 
                echo $style;
                ?>
">
							<?php 
                foreach ($families as $family => $font) {
                    ?>
								<?php 
                    if (is_array($font)) {
                        ?>
									<option value="<?php 
                        echo $family;
                        ?>
"><?php 
                        echo $font['family'];
                        ?>
</option>
								<?php 
                    }
                    ?>
							<?php 
                }
                ?>
						</optgroup>
					<?php 
            }
            ?>
				</select>
			</label>
			<?php 
        }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:53,代码来源:controls.php

示例8: thb_add_footerstripes_posttype_config_metabox

 function thb_add_footerstripes_posttype_config_metabox()
 {
     $consumer_key = thb_get_option('twitter_consumer_key');
     $consumer_secret = thb_get_option('twitter_consumer_secret');
     $oauth_token = thb_get_option('twitter_oauth_token');
     $oauth_token_secret = thb_get_option('twitter_oauth_token_secret');
     $config_note = '';
     if ($consumer_key == '' || $consumer_secret == '' || $oauth_token == '' || $oauth_token_secret == '') {
         $config_note = __('Make sure to fill the required Twitter API settings in the "Theme options > Social" tab.', 'thb_text_domain');
     }
     $post_type = thb_theme()->getPostType('footerstripes');
     $thb_metabox = new THB_Metabox(__('Footer contents', 'thb_text_domain'), 'footerstripes_config');
     $thb_container = $thb_metabox->createContainer('', 'footerstripes_config_container');
     $thb_field = new THB_SelectField('footerstripes_content_type');
     $thb_field->setLabel(__('Content type', 'thb_text_domain'));
     $thb_field->setOptions(array('twitter' => __('Twitter', 'thb_text_domain'), 'call-to-action' => __('Call to action', 'thb_text_domain'), 'social' => __('Social', 'thb_text_domain')));
     $thb_container->addField($thb_field);
     // Twitter
     $thb_container = $thb_metabox->createContainer(__('Twitter', 'thb_text_domain'), 'footerstripes_content_type_twitter');
     $thb_container->setIntroText($config_note);
     $thb_field = new THB_TextField('footerstripes_twitter_username');
     $thb_field->setLabel(__('Username', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_NumberField('footerstripes_twitter_num');
     $thb_field->setLabel(__('Tweets #', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     // Social
     $thb_container = $thb_metabox->createContainer(__('Social', 'thb_text_domain'), 'footerstripes_content_type_social');
     $thb_field = new THB_TextField('footerstripes_social_services');
     $thb_field->setLabel(__('Services', 'thb_text_domain'));
     $thb_field->setHelp(__('Comma separated, order matters', 'thb_text_domain') . '. ' . __('Possible values', 'thb_text_domain') . ': twitter, facebook, googleplus, flickr, youtube, vimeo, pinterest, dribbble, forrst.');
     $thb_container->addField($thb_field);
     // Call to action
     $thb_container = $thb_metabox->createContainer(__('Call to action', 'thb_text_domain'), 'footerstripes_content_type_call-to-action');
     $thb_field = new THB_TextField('footerstripes_call-to-action_big_text');
     $thb_field->setLabel(__('Big text', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_TextareaField('footerstripes_call-to-action_small_text');
     $thb_field->setLabel(__('Small text', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_TextField('footerstripes_call-to-action_btn_text');
     $thb_field->setLabel(__('Button text', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_TextField('footerstripes_call-to-action_btn_url');
     $thb_field->setLabel(__('Button URL', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $post_type->addMetabox($thb_metabox);
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:48,代码来源:posttype.php

示例9: thb_add_sidebar_metabox

 function thb_add_sidebar_metabox()
 {
     $thb_theme = thb_theme();
     // $thb_posts = $thb_theme->getPostType('post');
     // $thb_pages = $thb_theme->getPostType('page');
     // $thb_posts->addMetabox( thb_sidebars_metabox('post') );
     foreach (thb_config('core/sidebars', 'templates') as $template) {
         if (thb_is_admin_template($template)) {
             $post_type = thb_get_post_type_from_template($template);
             $thb_metabox = $thb_theme->getPostType($post_type)->getMetabox('layout');
             if ($thb_metabox) {
                 $thb_metabox->addContainer(thb_sidebars_metabox_container($post_type));
             }
         }
     }
     // $thb_pages->addMetaboxToPages( thb_sidebars_metabox(), thb_config('core/sidebars', 'templates') );
     // $thb_pages->addMetabox( thb_sidebars_metabox(), thb_config('core/sidebars', 'templates') );
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:18,代码来源:posttype.php

示例10: thb_portfolio_post_type

/**
 * Portfolio custom post type.
 *
 * ---
 *
 * The Happy Framework: WordPress Development Framework
 * Copyright 2012, Andrea Gandino & Simone Maranzana
 *
 * Licensed under The MIT License
 * Redistribuitions of files must retain the above copyright notice.
 *
 * @package THB Portfolio
 * @author The Happy Bit <thehappybit@gmail.com>
 * @copyright Copyright 2012, Andrea Gandino & Simone Maranzana
 * @link http://
 * @since The Happy Framework v 1.0
 * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
 */
function thb_portfolio_post_type()
{
    /**
     * The post type labels.
     *
     * @see http://codex.wordpress.org/Function_Reference/register_post_type
     */
    $thb_works_labels = array('name' => __('Portfolio', 'thb-portfolio'), 'singular_name' => __('Work', 'thb-portfolio'), 'add_new' => __('Add new', 'thb-portfolio'), 'add_new_item' => __('Add new Work', 'thb-portfolio'), 'edit' => __('Edit', 'thb-portfolio'), 'edit_item' => __('Edit Work', 'thb-portfolio'), 'new_item' => __('New Work', 'thb-portfolio'), 'view' => __('View Work', 'thb-portfolio'), 'view_item' => __('View Work', 'thb-portfolio'), 'search_items' => __('Search Works', 'thb-portfolio'), 'not_found' => __('No Works found', 'thb-portfolio'), 'not_found_in_trash' => __('No Works found in Trash', 'thb-portfolio'), 'parent' => __('Parent Work', 'thb-portfolio'));
    /**
     * The post type arguments.
     *
     * @see http://codex.wordpress.org/Function_Reference/register_post_type
     */
    if (thb_portfolio_framework_check()) {
        $options_slug = thb_get_option('works_url_slug');
    } else {
        $options_slug = apply_filters('thb_portfolio_slug', '');
    }
    $slug = !empty($options_slug) ? $options_slug : 'works';
    $thb_works_args = array('labels' => $thb_works_labels, 'public' => true, 'show_ui' => true, 'capability_type' => 'post', 'hierarchical' => false, 'rewrite' => array('slug' => $slug, 'with_front' => true), 'query_var' => true, 'show_in_nav_menus' => true, 'supports' => array('title', 'thumbnail', 'excerpt', 'editor', 'comments', 'custom-fields'));
    /**
     * Create the post type object.
     */
    register_post_type('works', $thb_works_args);
    if (thb_portfolio_framework_check()) {
        $thb_works = new THB_PostType('works', $thb_works_args);
    }
    /**
     * Create the post type taxonomy for Works categories.
     */
    $thb_portfolio_categories_args = array('hierarchical' => true, 'labels' => array('name' => __('Portfolio Categories', 'thb-portfolio'), 'singular_name' => __('Portfolio Category', 'thb-portfolio'), 'search_items' => __('Search Portfolio Categories', 'thb-portfolio'), 'all_items' => __('All Portfolio Categories', 'thb-portfolio'), 'parent_item' => __('Parent Portfolio Category', 'thb-portfolio'), 'parent_item_colon' => __('Parent Portfolio Category:', 'thb-portfolio'), 'edit_item' => __('Edit Portfolio Category', 'thb-portfolio'), 'update_item' => __('Update Portfolio Category', 'thb-portfolio'), 'add_new_item' => __('Add New Portfolio Category', 'thb-portfolio'), 'new_item_name' => __('New Portfolio Category Name', 'thb-portfolio'), 'menu_name' => __('Portfolio Category', 'thb-portfolio')), 'rewrite' => true, 'query_var' => true);
    register_taxonomy('portfolio_categories', 'works', $thb_portfolio_categories_args);
    if (thb_portfolio_framework_check()) {
        $thb_works_taxonomy = new THB_Taxonomy('portfolio_categories', $thb_portfolio_categories_args);
        $thb_works->addTaxonomy($thb_works_taxonomy);
    }
    /**
     * Add the post type to the theme instance.
     */
    if (thb_portfolio_framework_check()) {
        $thb_theme = thb_theme();
        $thb_theme->addPostType($thb_works);
    }
}
开发者ID:joasssko,项目名称:schk,代码行数:62,代码来源:posttype.php

示例11: thb_photogallery_container

 function thb_photogallery_container()
 {
     $thb_theme = thb_theme();
     $thb_photogallery_page_template = thb_config('core/photogallery', 'templates');
     if (thb_is_admin_template($thb_photogallery_page_template)) {
         $thb_metabox = new THB_Metabox(__('Gallery', 'thb_text_domain'), 'slideshow');
         $thb_container = $thb_metabox->createContainer(__('Configuration', 'thb_text_domain'), 'photogallery_masonry_details_container');
         $thb_field = new THB_NumberField('slides_per_page');
         $thb_field->setLabel(__('Pictures per page', 'thb_text_domain'));
         // $thb_field->setHelp( __('In case of AJAX loading, chose how many pictures to display.', 'thb_text_domain') );
         $thb_field->setHelp(__('Choose how many pictures to load dinamically. Leaving this empty will show all the images available.', 'thb_text_domain'));
         $thb_container->addField($thb_field);
         $thb_field = new THB_SelectField('portfolio_columns');
         $thb_field->setLabel(thb_config('core/photogallery', 'grid_templates_columns_label'));
         $thb_field->setOptions(thb_config('core/photogallery', 'grid_templates_columns'));
         $thb_container->addField($thb_field);
         $image_sizes = thb_config('core/photogallery', 'image_sizes');
         if (!empty($image_sizes)) {
             $slides_size_options = array();
             if (is_array(current($image_sizes))) {
                 $slides_size_options[] = __('Fixed', 'thb_text_domain');
                 $slides_size_options[] = __('Variable', 'thb_text_domain');
             } else {
                 $slides_size_options[$image_sizes[0]] = __('Fixed', 'thb_text_domain');
                 $slides_size_options[$image_sizes[1]] = __('Variable', 'thb_text_domain');
             }
             $thb_field = new THB_SelectField('slides_size');
             $thb_field->setLabel(__('Photos height', 'thb_text_domain'));
             $thb_field->setOptions($slides_size_options);
             $thb_container->addField($thb_field);
         }
         $thb_container = $thb_metabox->createDuplicableContainer(__('Photos', 'thb_text_domain'), 'photogallery_slides');
         $thb_container->setSortable();
         $thb_container->addControl(__('Add photo', 'thb_text_domain'), 'add_image', 'images.png', array('action' => 'thb_add_multiple_slides', 'title' => __('Add photos', 'thb_text_domain')));
         $field = new THB_SlideField('photogallery_slide');
         $field->setLabel(__('Slide', 'thb_text_domain'));
         $thb_container->setField($field);
         $thb_theme->getPostType('page')->addMetabox($thb_metabox);
     }
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:40,代码来源:module.php

示例12: add_filter

                }
            }
        } else {
            if (!is_archive() && !is_search() && !is_404()) {
                if (is_active_sidebar('post-sidebar')) {
                    $classes[] = 'w-sidebar';
                }
            }
        }
        return $classes;
    }
    add_filter('body_class', 'sidebars_body_classes');
}
/**
 * Dynamic sidebars options
 * -----------------------------------------------------------------------------
 */
if (thb_config('core/sidebars', 'options')) {
    $thb_options_page = thb_theme()->getAdmin()->getMainPage();
    $thb_tab = new THB_Tab(__('Sidebars', 'thb_text_domain'), 'sidebars');
    $thb_options_page->addTab($thb_tab, 2);
    if (thb_config('core/sidebars', 'duplicable')) {
        $thb_tab = $thb_options_page->getTab('sidebars');
        $thb_container = $thb_tab->createDuplicableContainer(__('Sidebars', 'thb_text_domain'), 'sidebars');
        $thb_container->addControl(__('Add new sidebar', 'thb_text_domain'), '');
        $thb_container->setSortable();
        $thb_field = new THB_TextField(THB_DUPLICABLE_SIDEBARS);
        $thb_field->setLabel(__('Name', 'thb_text_domain'));
        $thb_container->setField($thb_field);
    }
}
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:31,代码来源:module.php

示例13: thb_works_slideshow_metabox

 function thb_works_slideshow_metabox()
 {
     $thb_theme = thb_theme();
     $thb_works = $thb_theme->getPostType('works');
     $thb_metabox = new THB_Metabox(__('Work images and videos', 'thb_text_domain'), 'portfolio_slides_config');
     $thb_metabox->setPriority('high');
     if (thb_config('core/portfolio', 'work_slides_config')) {
         $thb_metabox->addContainer(call_user_func(thb_config('core/portfolio', 'work_slides_config')));
     }
     $thb_metabox->addContainer(thb_create_slideshows_slides_container('', array('slides_key' => thb_config('core/portfolio', 'work_slides_key'))));
     $thb_works->addMetabox($thb_metabox);
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:12,代码来源:posttype.php

示例14: thb_add_entry_slideshow_metabox

 /**
  * Add a Slideshow metabox to the specified page templates.
  *
  * @param array $templates The page templates.
  * @return void
  */
 function thb_add_entry_slideshow_metabox($templates)
 {
     $thb_metabox = thb_create_entry_slideshow_metabox();
     foreach ($templates as $template) {
         $post_type = thb_theme()->getPostType(thb_get_post_type_from_template($template));
         if (thb_is_admin_template($template)) {
             $post_type->addMetabox($thb_metabox);
         }
     }
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:16,代码来源:posttype.php

示例15: thb_woocommerce_extra_options

 function thb_woocommerce_extra_options()
 {
     $thb_theme = thb_theme();
     $thb_page = $thb_theme->getAdmin()->getMainPage();
     $thb_tab = $thb_page->getTab('woocommerce');
     $thb_container = $thb_tab->createContainer(__('Shop general options', 'thb_text_domain'), 'woocommerce_general_options');
     $thb_field = new THB_YesNoField('enable_shop_cart_allpages');
     $thb_field->setLabel(__('Enable shop cart on all pages', 'thb_text_domain'));
     $thb_field->setHelp(__('Choose if you want to enable the shop cart on header on all pages or only for "Shop" related pages.', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_container = $thb_tab->getContainer('woocommerce_shop_options');
     $thb_field = new THB_SelectField('woocommerce_shop_pageheader_layout');
     $thb_field->setLabel(__('Page header layout', 'thb_text_domain'));
     $thb_field->setOptions(array('left' => __('Left', 'thb_text_domain'), 'center' => __('Center', 'thb_text_domain'), 'right' => __('Right', 'thb_text_domain')));
     $thb_container->addField($thb_field);
     $thb_field = new THB_SelectField('woocommerce_shop_pageheader_height');
     $thb_field->setLabel(__('Page header height', 'thb_text_domain'));
     $thb_field->setOptions(array('pageheader-big' => __('Large', 'thb_text_domain'), 'pageheader-compact' => __('Compact', 'thb_text_domain')));
     $thb_field->setHelp(__('This setting will affect also the shop\'s archive and taxonomy pages.', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_UploadField('woocommerce_shop_pageheader_background_image');
     $thb_field->setLabel(__('Page header background image', 'thb_text_domain'));
     $thb_container->addField($thb_field);
     $thb_field = new THB_NumberField('woocommerce_shop_pageheader_background_opacity');
     $thb_field->setMin(0);
     $thb_field->setMax(1);
     $thb_field->setStep(0.05);
     $thb_field->setLabel(__('Page header background opacity', 'thb_text_domain'));
     $thb_container->addField($thb_field);
 }
开发者ID:alfredpp,项目名称:sarath-portfolio,代码行数:30,代码来源:theme-woocommerce.php


注:本文中的thb_theme函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。