本文整理汇总了PHP中dh_get_theme_option函数的典型用法代码示例。如果您正苦于以下问题:PHP dh_get_theme_option函数的具体用法?PHP dh_get_theme_option怎么用?PHP dh_get_theme_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了dh_get_theme_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dh_get_mailchimplist
function dh_get_mailchimplist()
{
$options = array(__('Nothing Found...', DH_DOMAIN));
if ($mailchimp_api = dh_get_theme_option('mailchimp_api', '')) {
if (!class_exists('MCAPI')) {
include_once DHINC_DIR . '/lib/MCAPI.class.php';
}
$api = new MCAPI($mailchimp_api);
$lists = $api->lists();
if ($api->errorCode) {
$options = array(__("Unable to load MailChimp lists, check your API Key.", DH_DOMAIN));
} else {
if ($lists['total'] == 0) {
$options = array(__("You have not created any lists at MailChimp", DH_DOMAIN));
} else {
$options = array(__('Select a list', DH_DOMAIN));
foreach ($lists['data'] as $list) {
$options[$list['id']] = $list['name'];
}
}
}
}
return $options;
}
示例2: dh_format_color
<?php
$brand_success = dh_format_color(dh_get_theme_option('brand-success', '#262626'));
$brand_success = apply_filters('dh_brand_success', dhecho($brand_success));
if ($brand_success === '#262626') {
return '';
}
$darken_10_brand_success = darken(dh_format_color($brand_success), '10%');
$darken_12_brand_success = darken(dh_format_color($brand_success), '12%');
?>
.text-success {
color: <?php
echo dhecho($brand_success);
?>
;
}
.blockquote-success {
border-color: <?php
echo dhecho($brand_success);
?>
;
}
.btn-success {
background-color: <?php
echo dhecho($brand_success);
?>
;
border-color: <?php
echo dhecho($brand_success);
?>
;
示例3: dh_page_title
function dh_page_title($echo = true)
{
$title = "";
if (is_category()) {
$title = single_cat_title('', false);
} elseif (is_day()) {
$title = __('Archive for date:', DH_DOMAIN) . " " . get_the_time('F jS, Y');
} elseif (is_month()) {
$title = __('Archive for month:', DH_DOMAIN) . " " . get_the_time('F, Y');
} elseif (is_year()) {
$title = __('Archive for year:', DH_DOMAIN) . " " . get_the_time('Y');
} elseif (is_search()) {
global $wp_query;
if (!empty($wp_query->found_posts)) {
if ($wp_query->found_posts > 1) {
$title = $wp_query->found_posts . " " . __('search results for', DH_DOMAIN) . ' <span class="search-query">' . esc_attr(get_search_query()) . '</span>';
} else {
$title = $wp_query->found_posts . " " . __('search result for', DH_DOMAIN) . ' <span class="search-query">' . esc_attr(get_search_query()) . '</span>';
}
} else {
if (!empty($_GET['s'])) {
$title = __('Search results for', DH_DOMAIN) . ' <span class="search-query">' . esc_attr(get_search_query()) . '</span>';
} else {
$title = __('To search the site please enter a valid term', DH_DOMAIN);
}
}
} elseif (is_author()) {
$curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
if (isset($curauth->nickname)) {
$title = $curauth->nickname;
}
} elseif (is_tag()) {
$title = single_tag_title('', false);
} elseif (is_tax()) {
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
$title = $term->name;
} elseif (is_front_page() && !is_home()) {
$title = get_the_title(get_option('page_on_front'));
} elseif (is_home() && !is_front_page()) {
$title = get_the_title(get_option('page_for_posts'));
} elseif (is_404()) {
$title = __('404 - Page not found', DH_DOMAIN);
} else {
$title = get_the_title();
}
if (isset($_GET['paged']) && !empty($_GET['paged'])) {
$title .= " (" . __('Page', DH_DOMAIN) . " " . $_GET['paged'] . ")";
}
if (defined('WOOCOMMERCE_VERSION') && is_woocommerce() && (is_product() || is_shop()) && !is_search()) {
// if( ! is_product() ) {
// $title = woocommerce_page_title( false );
// }else{
// $title =
// }
$title = woocommerce_page_title(false);
}
if (is_post_type_archive('portfolio')) {
$title = esc_html(dh_get_theme_option('portfolio-archive-title', __('My Portfolio', DH_DOMAIN)));
}
if ($echo) {
echo dhecho($title);
} else {
return $title;
}
}
示例4: woocommerce_template_single_title
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
*/
if (dh_get_theme_option('woo-product-layout', 'full-width') === 'full-width') {
woocommerce_template_single_title();
woocommerce_template_single_rating();
woocommerce_template_single_excerpt();
} else {
do_action('woocommerce_single_product_summary');
}
?>
</div><!-- .summary -->
</div>
<?php
if (dh_get_theme_option('woo-product-layout', 'full-width') === 'full-width') {
?>
<div class="col-md-3 col-sm-6 action-summary">
<div class="summary">
<?php
do_action('woocommerce_single_product_summary');
?>
</div>
</div>
<?php
}
?>
</div>
<?php
/**
* woocommerce_after_single_product_summary hook
示例5: dh_format_color
<?php
$brand_danger = dh_format_color(dh_get_theme_option('brand-danger', '#bb5857'));
$brand_danger = apply_filters('dh_brand_danger', $brand_danger);
if ($brand_danger === '#bb5857') {
return '';
}
$darken_10_brand_danger = darken(dh_format_color(dh_get_theme_option('brand-danger', '#bb5857')), '10%');
$darken_12_brand_danger = darken(dh_format_color(dh_get_theme_option('brand-danger', '#bb5857')), '12%');
?>
.text-danger {
color: <?php
echo dhecho($brand_danger);
?>
;
}
.blockquote-danger {
border-color: <?php
echo dhecho($brand_danger);
?>
;
}
.btn-danger {
background-color: <?php
echo dhecho($brand_danger);
?>
;
border-color: <?php
echo dhecho($brand_danger);
?>
;
示例6: end_el
public function end_el(&$output, $item, $depth = 0, $args = array())
{
$output .= "</li>\n";
$header_style = dh_get_theme_option('header-style', 'below');
if (dh_get_theme_option('site-style', 'default') == 'creative') {
$header_style = 'center';
}
if ($header_style == 'center') {
static $static_nav_count = 0;
if ($depth === 0) {
$logo_url = dh_get_theme_option('logo');
$logo_fixed_url = dh_get_theme_option('logo-fixed', '');
$logo_transparent_url = dh_get_theme_option('logo-transparent', '');
$logo_mobile_url = dh_get_theme_option('logo-mobile', '');
if (empty($logo_fixed_url)) {
$logo_fixed_url = $logo_url;
}
if (empty($logo_mobile_url)) {
$logo_mobile_url = $logo_url;
}
$menu_transparent = dh_get_theme_option('menu-transparent', 0);
if ($menu_transparent) {
$logo_url = $logo_transparent_url;
}
$logo_html = '';
if (empty($logo_html)) {
ob_start();
?>
<a class="navbar-brand" data-itemprop="url" title="<?php
esc_attr(bloginfo('name'));
?>
" href="<?php
echo esc_url(home_url('/'));
?>
">
<?php
if (!empty($logo_url)) {
?>
<img class="logo" alt="<?php
bloginfo('name');
?>
" src="<?php
echo esc_url($logo_url);
?>
">
<?php
} else {
?>
<?php
echo bloginfo('name');
?>
<?php
}
?>
<img class="logo-fixed" alt="<?php
bloginfo('name');
?>
" src="<?php
echo esc_url($logo_fixed_url);
?>
">
<img class="logo-mobile" alt="<?php
bloginfo('name');
?>
" src="<?php
echo esc_url($logo_mobile_url);
?>
">
<meta itemprop="name" content="<?php
bloginfo('name');
?>
">
</a>
<?php
$logo_html = ob_get_clean();
}
$static_nav_count++;
if ($static_nav_count == round($this->_number_of_root_elements / 2, 0, PHP_ROUND_HALF_DOWN)) {
$output .= '<li class="menu-item-navbar-brand">' . $logo_html . '</li>';
}
}
}
}
示例7: dh_get_theme_option
* @version 2.2.2
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
global $wp_query;
$woo_products_pagination = dh_get_theme_option('woo-products-pagination', 'page_num');
?>
<nav class="woocommerce-pagination">
<?php
woocommerce_result_count();
?>
<?php
if ($wp_query->max_num_pages > 1) {
dh_paginate_links();
}
?>
</nav>
<?php
if ($woo_products_pagination === 'loadmore' && 1 < $wp_query->max_num_pages) {
?>
<div class="loadmore-action">
<div class="loadmore-loading"><div class="fade-loading"><i></i><i></i><i></i><i></i></div></div>
<button type="button" class="btn-loadmore"><?php
echo esc_html(dh_get_theme_option('woo-products-loadmore-text', 'Load More'));
?>
</button>
</div>
<?php
}
示例8:
<?php
}
?>
<?php
}
?>
</div>
</div>
</div>
</div>
<?php
}
?>
<?php
if ($footer_info = dh_get_theme_option('footer-info')) {
?>
<div class="footer-copyright text-center"><?php
echo $footer_info;
?>
</div>
<?php
}
?>
</footer>
</div>
<?php
wp_footer();
?>
</body>
示例9: dh_format_color
<?php
$brand_warning = dh_format_color(dh_get_theme_option('brand-warning', '#f0ad4e'));
$brand_warning = apply_filters('dh_brand_warning', $brand_warning);
if ($brand_warning === '#f0ad4e') {
return '';
}
$darken_10_brand_warning = darken(dh_format_color($brand_warning), '10%');
$darken_12_brand_warning = darken(dh_format_color($brand_warning), '12%');
?>
.text-warning {
color: <?php
echo dhecho($brand_warning);
?>
;
}
.blockquote-warning {
border-color: <?php
echo dhecho($brand_warning);
?>
;
}
.btn-warning {
background-color: <?php
echo dhecho($brand_warning);
?>
;
border-color: <?php
echo dhecho($brand_warning);
?>
;
示例10: apply_filters
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.4.0
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
/**
* Filter tabs and allow third parties to add their own
*
* Each tab is an array containing title, callback and priority.
* @see woocommerce_default_product_tabs() 0905032132
*/
$tabs = apply_filters('woocommerce_product_tabs', array());
$layout = dh_get_theme_option('woo-product-layout', 'full-width');
if (!empty($tabs)) {
?>
<div class="woocommerce-tab-container woocommerce-tab-<?php
echo $layout;
?>
">
<?php
if ($layout == 'full-width') {
?>
<div class="<?php
dh_container_class();
?>
">
<div class="row">
<div class="col-md-12">
示例11:
entry-summary">
<div class="summary">
<?php
/**
* woocommerce_single_product_summary hook
*
* @hooked woocommerce_template_single_title - 5
* @hooked woocommerce_template_single_rating - 10
* @hooked woocommerce_template_single_price - 10
* @hooked woocommerce_template_single_excerpt - 20
* @hooked woocommerce_template_single_add_to_cart - 30
* @hooked woocommerce_template_single_meta - 40
* @hooked woocommerce_template_single_sharing - 50
*/
if (!dh_get_theme_option('show-woo-meta', 1)) {
remove_action('woocommerce_single_product_summary', 'woocommerce_template_single_meta', 40);
}
do_action('woocommerce_single_product_summary');
?>
<div>
<a href="#product-enquiry" class="btn btn-black">Product Enquiry</a>
</div>
</div><!-- .summary -->
</div>
</div>
<?php
if ($layout == 'full-width') {
?>
</div>
示例12: dh_get_theme_option
/**
* Single Product Thumbnails
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.3.0
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
global $post, $product, $woocommerce;
$selected = false;
$attachment_ids = $product->get_gallery_attachment_ids();
$style = dh_get_theme_option('single-product-style', 'style-1');
if ($attachment_ids) {
?>
<div class="single-product-thumbnails" data-item_template = "<?php
echo esc_attr('<li class="caroufredsel-item' . ($style != 'style-1' ? ' col-sm-3 col-xs-6' : '') . '"><div class="thumb"><a href="#" title="__image_title__">__image__</a></div></li>');
?>
">
<div class="caroufredsel product-thumbnails-slider" data-visible-min="2" data-visible-max="4" data-scrollduration="500" <?php
if ($style == 'style-1') {
?>
data-direction="up" data-height="100%" data-responsive="0" data-circular="1" <?php
} else {
?>
data-circular="0" data-scroll-fx="scroll" data-responsive="1" <?php
}
?>
示例13: wp_nav_menu
<div class="col-sm-6">
<?php
if (dh_get_theme_option('footer-menu', 1)) {
?>
<div class="footer-menu">
<?php
if (has_nav_menu('footer')) {
wp_nav_menu(array('theme_location' => 'footer', 'container' => false, 'depth' => 1, 'menu_class' => 'footer-nav', 'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>', 'walker' => new DHWalker()));
}
?>
</div>
<?php
}
?>
<?php
if ($footer_copyright = dh_get_theme_option('footer-copyright')) {
?>
<div class="copyright"><?php
echo dhecho($footer_copyright);
?>
</div>
<?php
}
?>
</div>
</div>
</div>
</div>
</div>
</footer>
<?php
示例14: dynamic_sidebar
?>
<?php
if (is_active_sidebar('sidebar-header')) {
dynamic_sidebar('sidebar-header');
}
?>
<?php
}
?>
</div>
</div>
</div>
<div class="navbar-container">
<div class="navbar navbar-default <?php
if (dh_get_theme_option('sticky-menu', 1)) {
?>
navbar-scroll-fixed<?php
}
?>
">
<div class="navbar-primary-nav">
<div class="<?php
dh_container_class();
?>
">
<div class="navbar-wrap">
<nav class="collapse navbar-collapse primary-navbar-collapse" itemtype="<?php
echo dh_get_protocol();
?>
://schema.org/SiteNavigationElement" itemscope="itemscope" role="navigation">
示例15: enqueue_theme_styles
public function enqueue_theme_styles()
{
$protocol = dh_get_protocol();
$suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
$main_css_id = basename(get_template_directory());
//Playfair Display
dh_enqueue_google_font();
if ('off' !== _x('on', 'Google font: on or off', 'jakiro')) {
wp_enqueue_style('dh-google-font-montserrat', 'http://fonts.googleapis.com/css?family=Montserrat:400,700|Droid+Serif:400,700');
}
wp_enqueue_style('vendor-elegant-icon');
wp_enqueue_style('vendor-font-awesome');
wp_register_style($main_css_id, get_template_directory_uri() . '/assets/css/style.css', false, DH_THEME_VERSION);
if (class_exists('WPCF7_ContactForm')) {
wp_deregister_style('contact-form-7');
}
wp_enqueue_style($main_css_id);
if (defined('WOOCOMMERCE_VERSION')) {
wp_enqueue_style($main_css_id . '-woocommerce', get_template_directory_uri() . '/assets/css/woocommerce' . $suffix . '.css', array($main_css_id), DH_THEME_VERSION);
}
wp_register_style($main_css_id . '-wp', get_stylesheet_uri(), false, DH_THEME_VERSION);
do_action('dh_main_inline_style', $main_css_id);
if ($custom_css = dh_get_theme_option('custom-css')) {
wp_add_inline_style($main_css_id . '-wp', $custom_css);
}
$fix_el_apper = '@media (max-width: ' . apply_filters('dh_js_breakpoint', 992) . 'px) {.animate-box.animated{visibility: visible;}.column[data-fade="1"]{opacity: 1;filter: alpha(opacity=100);}.el-appear{opacity: 1;filter: alpha(opacity=100);-webkit-transform: scale(1);-ms-transform: scale(1);-o-transform: scale(1);transform: scale(1);}}';
wp_add_inline_style($main_css_id . '-wp', $fix_el_apper);
wp_enqueue_style($main_css_id . '-wp');
}