本文整理匯總了PHP中sgwindow_get_theme_mod函數的典型用法代碼示例。如果您正苦於以下問題:PHP sgwindow_get_theme_mod函數的具體用法?PHP sgwindow_get_theme_mod怎麽用?PHP sgwindow_get_theme_mod使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了sgwindow_get_theme_mod函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: sgwindow_customize_register_other
/**
* Add new fields to customizer, create panel 'Other' and register postMessage support for site title and description for the Customizer.
*
* @param WP_Customize_Manager $wp_customize Customizer object.
* @since SG Window 1.0.0
*/
function sgwindow_customize_register_other($wp_customize)
{
$defaults = sgwindow_get_defaults();
$wp_customize->add_panel('other', array('priority' => 106, 'title' => __('Customize Other Settings', 'sg-window'), 'description' => __('All other settings.', 'sg-window')));
$section_priority = 10;
//New section in customizer: Logotype
$wp_customize->add_section('sgwindow_theme_logotype', array('title' => __('Logotype', 'sg-window'), 'priority' => $section_priority++, 'panel' => 'other'));
//New setting in Logotype section: Logo Image
$wp_customize->add_setting('logotype_url', array('default' => get_template_directory_uri() . '/img/logo.png', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_url'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'logotype_url', array('label' => __('Logotype Image', 'sg-window'), 'section' => 'sgwindow_theme_logotype', 'settings' => 'logotype_url', 'priority' => '1')));
//New section in customizer: Fixed Background
$wp_customize->add_section('column_background_url', array('title' => __('Fixed Background', 'sg-window'), 'priority' => $section_priority++, 'panel' => 'background'));
//column background image
$wp_customize->add_setting('column_background_url', array('default' => $defaults['column_background_url'], 'transport' => 'postMessage', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_background_url'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'column_background_url', array('label' => __('Site Background', 'sg-window'), 'section' => 'column_background_url', 'settings' => 'column_background_url', 'priority' => 1)));
//background position
$wp_customize->add_setting('top', array('default' => $defaults['top'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_background_position'));
$wp_customize->add_control('top', array('label' => __('Vertical position', 'sg-window'), 'section' => 'column_background_url', 'settings' => 'top', 'type' => 'select', 'priority' => 2, 'choices' => array('top' => __('Top', 'sg-window'), 'center' => __('Center', 'sg-window'), 'bottom' => __('Bottom', 'sg-window'))));
//New section in customizer: Navigation Options
$wp_customize->add_section('sgwindow_nav_options', array('title' => __('Navigation menu settings', 'sg-window'), 'priority' => $section_priority++, 'panel' => 'navigation'));
//New setting in Navigation section: Switch On First Top Menu
$wp_customize->add_setting('is_show_top_menu', array('default' => $defaults['is_show_top_menu'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_checkbox'));
$wp_customize->add_control('is_show_top_menu', array('label' => __('Switch On First Top Menu', 'sg-window'), 'section' => 'sgwindow_nav_options', 'settings' => 'is_show_top_menu', 'type' => 'checkbox', 'priority' => $section_priority++, 'panel' => 'other'));
//New setting in Navigation section: Switch On Second Top Menu
$wp_customize->add_setting('is_show_secont_top_menu', array('default' => $defaults['is_show_secont_top_menu'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_checkbox'));
$wp_customize->add_control('sgwindow_is_show_secont_top_menu', array('label' => __('Switch On Second Top Menu', 'sg-window'), 'section' => 'sgwindow_nav_options', 'settings' => 'is_show_secont_top_menu', 'type' => 'checkbox', 'priority' => 22));
//New setting in Navigation section: Switch On Footer Menu
$wp_customize->add_setting('is_show_footer_menu', array('default' => $defaults['is_show_footer_menu'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_checkbox'));
$wp_customize->add_control('sgwindow_is_show_footer_menu', array('label' => __('Switch On Footer Menu', 'sg-window'), 'section' => 'sgwindow_nav_options', 'settings' => 'is_show_footer_menu', 'type' => 'checkbox', 'priority' => 23));
//New section in the customizer: Scroll To Top Button
$wp_customize->add_section('sgwindow_scroll', array('title' => __('Scroll To Top Button', 'sg-window'), 'priority' => $section_priority++, 'panel' => 'other'));
$wp_customize->add_setting('scroll_button', array('default' => $defaults['scroll_button'], 'capability' => 'edit_theme_options', 'transport' => 'refresh', 'sanitize_callback' => 'sgwindow_sanitize_scroll_button'));
$wp_customize->add_control('scroll_button', array('label' => __('How to display the scroll to top button', 'sg-window'), 'section' => 'sgwindow_scroll', 'settings' => 'scroll_button', 'type' => 'select', 'priority' => 1, 'choices' => array('none' => __('None', 'sg-window'), 'right' => __('Right', 'sg-window'), 'left' => __('Left', 'sg-window'), 'center' => __('Center', 'sg-window'))));
$wp_customize->add_setting('scroll_animate', array('default' => $defaults['scroll_animate'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_scroll_effect'));
$wp_customize->add_control('scroll_animate', array('label' => __('How to animate the scroll to top button', 'sg-window'), 'section' => 'sgwindow_scroll', 'settings' => 'scroll_animate', 'type' => 'select', 'priority' => 1, 'choices' => array('none' => __('None', 'sg-window'), 'move' => __('Jump', 'sg-window'))));
//New section in the customizer: Favicon
$wp_customize->add_section('sgwindow_favicon', array('title' => __('Favicon', 'sg-window'), 'description' => __('You can select an Icon to be shown at the top of browser window by uploading from your computer. (Size: [16X16] px)', 'sg-window'), 'priority' => $section_priority++, 'panel' => 'other'));
$wp_customize->add_setting('favicon', array('default' => $defaults['favicon'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_url'));
$wp_customize->add_control(new WP_Customize_Image_Control($wp_customize, 'favicon', array('label' => __('Favicon', 'sg-window'), 'section' => 'sgwindow_favicon', 'settings' => 'favicon', 'priority' => '1')));
sgwindow_create_social_icons_section($wp_customize);
$wp_customize->add_setting('is_header_on_front_page_only', array('default' => $defaults['is_header_on_front_page_only'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_checkbox'));
$wp_customize->add_control('is_header_on_front_page_only', array('label' => __('Display Header Image on the Front Page only', 'sg-window'), 'section' => 'header_image', 'settings' => 'is_header_on_front_page_only', 'type' => 'checkbox', 'priority' => 40));
$wp_customize->add_setting('is_text_on_front_page_only', array('default' => $defaults['is_text_on_front_page_only'], 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_checkbox'));
$wp_customize->add_control('is_text_on_front_page_only', array('label' => __('Display Header Text on the Front Page only', 'sg-window'), 'section' => 'header_image', 'settings' => 'is_text_on_front_page_only', 'type' => 'checkbox', 'priority' => 41));
$wp_customize->add_section('check', array('title' => __('--', 'sg-window'), 'priority' => 200, 'panel' => 'other'));
if ('' == sgwindow_get_theme_mod('are_we_saved', '')) {
$wp_customize->add_setting('are_we_saved', array('type' => 'theme_mod', 'default' => '', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'sgwindow_sanitize_checkbox'));
$wp_customize->add_control('are_we_saved', array('label' => __('--', 'sg-window'), 'section' => 'check', 'settings' => 'are_we_saved', 'type' => 'checkbox', 'priority' => 1));
}
$wp_customize->add_setting('max_id', array('type' => 'theme_mod', 'default' => '0', 'capability' => 'edit_theme_options', 'sanitize_callback' => 'absint'));
$wp_customize->add_control('max_id', array('label' => __('Max id', 'sg-window'), 'section' => 'check', 'settings' => 'max_id', 'type' => 'input'));
}
示例2: __construct
function __construct()
{
$defaults = sgwindow_get_defaults();
$this->color_scheme = sgwindow_get_theme_mod('color_scheme', $defaults['color_scheme']);
$this->add_scheme(0, __('Blue', 'sg-window'));
$this->add_scheme(1, __('Green', 'sg-window'));
$this->add_scheme(2, __('Blue-White', 'sg-window'));
$section_id = 'main_colors';
$section_priority = 10;
$p = 10;
$this->add_section($section_id, __('Main Colors', 'sg-window'), __('Main website colors', 'sg-window'), $section_priority++);
/* colors */
$i = 'link_color';
$this->add_color($i, $section_id, __('Link', 'sg-window'), $p++, false);
$this->set_color($i, 0, '#1e73be');
$this->set_color($i, 1, '#b7ba2a');
$this->set_color($i, 2, '#1e73be');
$i = 'heading_color';
$this->add_color($i, $section_id, __('H1-H6 heading', 'sg-window'), $p++, false);
$this->set_color($i, 0, '#3f3f3f');
$this->set_color($i, 1, '#141414');
$this->set_color($i, 2, '#3f3f3f');
$i = 'heading_link';
$this->add_color($i, $section_id, __('H1-H6 Link', 'sg-window'), $p++, false);
$this->set_color($i, 0, '#1e73be');
$this->set_color($i, 1, '#b7ba2a');
$this->set_color($i, 2, '#1e73be');
$i = 'description_color';
$this->add_color($i, $section_id, __('Description', 'sg-window'), $p++, false);
$this->set_color($i, 0, '#ffffff');
$this->set_color($i, 1, '#fff');
$this->set_color($i, 2, '#ffffff');
$i = 'hover_color';
$this->add_color($i, $section_id, __('Link Hover', 'sg-window'), $p++, false, 'refresh');
$this->set_color($i, 0, '#45d61d');
$this->set_color($i, 1, '#dd3333');
$this->set_color($i, 2, '#45d61d');
add_action('customize_register', array($this, 'sgwindow_create_colors_controls'), 21);
add_action('sgwindow_option_defaults', array($this, 'sgwindow_add_defaults'));
add_action('customize_controls_print_scripts', array($this, 'sgwindow_print_customizer_js_colors'));
}
示例3: sgwindow_column_dir
/**
* Return array column-content direction .
*
* @return array sanitized direction.
* @since SG Window 1.0.0
*/
function sgwindow_column_dir()
{
$rez = array();
switch (sgwindow_get_theme_mod('columns_direction')) {
case 'c_1_2':
$rez['content'] = 1;
$rez['column-1'] = 2;
$rez['column-2'] = 3;
break;
case '2_1_c':
$rez['content'] = 3;
$rez['column-1'] = 2;
$rez['column-2'] = 1;
break;
case 'c_2_1':
$rez['content'] = 1;
$rez['column-1'] = 3;
$rez['column-2'] = 2;
break;
case '1_c_2':
$rez['content'] = 2;
$rez['column-1'] = 1;
$rez['column-2'] = 3;
break;
case '2_c_1':
$rez['content'] = 2;
$rez['column-1'] = 3;
$rez['column-2'] = 1;
break;
case '1_2_c':
$rez['content'] = 3;
$rez['column-1'] = 1;
$rez['column-2'] = 2;
break;
}
return $rez;
}
示例4: the_post
the_post();
get_template_part('content', 'jetpack-portfolio');
}
?>
</div><!-- .content -->
<div class="clear"></div>
<?php
sgwindow_post_nav();
if (comments_open() || get_comments_number()) {
comments_template();
}
} else {
?>
<div class="content">
<?php
get_template_part('content', 'none');
?>
</div><!-- .content -->
<?php
}
?>
</div><!-- .site-content -->
<?php
sgwindow_get_sidebar(sgwindow_get_theme_mod('layout_portfolio-page'));
?>
</div> <!-- .main-wrapper -->
<?php
get_footer();
示例5: dreamway_styles
/**
* Enqueue parent and child scripts
*
* @package WordPress
* @subpackage Dream Way
* @since Dream Way 1.0
*/
function dreamway_styles()
{
wp_enqueue_style('sgwindow-style', get_template_directory_uri() . '/style.css');
wp_enqueue_style('dreamway-style', get_stylesheet_uri(), array('sgwindow-style'));
wp_enqueue_style('dreamway-colors', get_stylesheet_directory_uri() . '/css/scheme-' . esc_attr(sgwindow_get_theme_mod('color_scheme')) . '.css', array('dreamway-style', 'sgwindow-colors'));
}
示例6: post_class
" <?php
post_class();
?>
>
<header class="entry-header">
<?php
if ('1' == sgwindow_get_theme_mod('is_display_page_title')) {
the_title('<h1 class="entry-title">', '</h1>');
}
?>
<?php
if (has_post_thumbnail() && '1' == sgwindow_get_theme_mod('is_display_page_image')) {
?>
<div class="entry-thumbnail">
<?php
the_post_thumbnail();
?>
</div>
<?php
}
?>
</header><!-- .entry-header -->
<div class="entry-content">
<?php
the_content();
示例7: sgwindow_hook_font_css
/**
* Add custom styles to the header.
*
* @since SG Window 1.0.1
*/
function sgwindow_hook_font_css()
{
$body_font = sgwindow_get_theme_mod('body_font');
$heading_font = sgwindow_get_theme_mod('heading_font');
if ('0' == $heading_font) {
$heading_font = $body_font;
}
$header_font = sgwindow_get_theme_mod('header_font');
if ('0' == $header_font) {
$header_font = $heading_font;
}
?>
<style type="text/css">
.site {
<?php
if ('0' != $body_font) {
?>
font-family: '<?php
echo esc_attr($body_font);
?>
', sans-serif;
<?php
}
?>
font-size: <?php
echo esc_attr(sgwindow_get_theme_mod('body_font_size'));
?>
px;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-weight: <?php
echo esc_attr(sgwindow_get_theme_mod('heading_weight'));
?>
;
<?php
if ('0' != $heading_font) {
?>
font-family: '<?php
echo esc_attr($heading_font);
?>
', sans-serif;
<?php
}
?>
}
<?php
if ('0' != $header_font) {
?>
.site .site-title h1,
.site-title a {
font-family: '<?php
echo esc_attr($header_font);
?>
', sans-serif;
}
<?php
}
?>
@media screen and (min-width: 680px) {
h1 {
font-size:<?php
echo esc_attr(sgwindow_get_theme_mod('heading_font_size'));
?>
px;
}
}
</style>
<?php
}
示例8: do_action
<div class="content-search">
<?php
do_action('sgwindow_after_content');
?>
</div><!-- .content-search -->
</div><!-- .content -->
<div class="clear"></div>
<?php
sgwindow_paging_nav();
} else {
?>
<div class="content">
<?php
get_template_part('content', 'none');
?>
</div><!-- .content -->
<?php
}
?>
</div><!-- .site-content -->
<?php
sgwindow_get_sidebar(sgwindow_get_theme_mod('layout_blog'));
?>
</div> <!-- .main-wrapper -->
<?php
get_footer();
示例9: get_width
function get_width($sidebar_id)
{
$width = sgwindow_get_theme_mod('width_top_widget_area') - 4;
return $width;
}
示例10: while
<?php
while (have_posts()) {
the_post();
get_template_part('content', get_post_format());
}
?>
</div><!-- .content -->
<div class="clear"></div>
<?php
sgwindow_paging_nav();
} else {
?>
<div class="content">
<?php
get_template_part('content', 'none');
?>
</div><!-- .content -->
<?php
}
?>
</div><!-- .site-content -->
<?php
sgwindow_get_sidebar(sgwindow_get_theme_mod('layout_default'));
?>
</div> <!-- .main-wrapper -->
<?php
get_footer();
示例11: the_excerpt
?>
</header><!-- .entry-header -->
<?php
if ('excerpt' == sgwindow_get_theme_mod('single_style') || 'content' == sgwindow_get_theme_mod('single_style') && is_search()) {
?>
<div class="entry-summary">
<?php
the_excerpt();
?>
</div><!-- .entry-summary -->
<?php
} elseif ('content' == sgwindow_get_theme_mod('single_style')) {
?>
<div class="entry-content">
<?php
the_content(__('<div class="meta-nav">Continue reading... →</div>', 'sg-diamond'));
?>
</div><!-- .entry-content -->
<?php
}
?>
<?php
edit_post_link(__('Edit', 'sg-diamond'), '<span title="' . __('Edit', 'sg-diamond') . '" class="edit-link">', '</span>');
?>
示例12: the_excerpt
?>
</header><!-- .entry-header -->
<?php
if ('excerpt' == sgwindow_get_theme_mod('portfolio_style')) {
?>
<div class="entry-summary">
<?php
the_excerpt();
?>
</div><!-- .entry-summary -->
<?php
} elseif ('content' == sgwindow_get_theme_mod('portfolio_style')) {
?>
<div class="entry-content">
<?php
the_content();
?>
</div><!-- .entry-content -->
<?php
}
?>
<footer class="entry-meta">
<span class="project" title="<?php
示例13: the_content
<?php
the_content(__('<div class="meta-nav">Read more... →</div>', 'sg-window'));
?>
<?php
wp_link_pages(array('before' => '<div class="page-links">' . __('Pages:', 'sg-window'), 'after' => '</div>'));
?>
</div><!-- .entry-content -->
<?php
}
?>
<div class="clear"></div>
<footer class="entry-footer">
<div class="entry-meta">
<?php
if ('1' == sgwindow_get_theme_mod('is_display_post_tags')) {
?>
<div class="tags">
<?php
echo get_the_tag_list('', ' ');
?>
</div>
<?php
}
?>
<span class="post-date">
<?php
sgwindow_posted_on();
示例14: sgwindow_header_image
/**
* Header image
*
* @since SG Window 1.1.0
*/
function sgwindow_header_image()
{
if (get_header_image() && (sgwindow_get_theme_mod('is_header_on_front_page_only') != '1' || is_front_page())) {
if ('1' != sgwindow_get_theme_mod('is_parallax_header')) {
?>
<!-- Banner -->
<div class="image-container">
<div class="image-wrapper">
<a href="<?php
echo esc_url(home_url('/'));
?>
">
<img src="<?php
header_image();
?>
" class="header-image" width="<?php
echo get_custom_header()->width;
?>
" height="<?php
echo get_custom_header()->height;
?>
" alt="" />
</a>
</div>
</div>
<?php
} else {
?>
<!-- Banner -->
<a href="<?php
echo esc_url(home_url('/'));
?>
">
<div class="my-image widget">
<div class="parallax-image <?php
echo esc_attr(sgwindow_get_theme_mod('parallax_image_speed'));
?>
0 0" style="background-image: url(<?php
header_image();
?>
);">
</div><!-- .parallax-image -->
</div><!-- .my-image -->
</a>
<?php
}
}
}
示例15: widget
//.........這裏部分代碼省略.........
echo esc_url(get_term_link($instance['product_cat'], $tax));
?>
" class="link" rel="bookmark"><?php
_e('All Products', 'sg-window');
?>
</a>
</article> <!-- article -->
</div> <!-- .description -->
<?php
}
?>
<div class="wrapper-image <?php
echo esc_attr($instance['columns']) . ($instance['is_step'] ? ' step' : ' all') . ($instance['is_hover_all'] ? ' hover-all' : '') . ($instance['is_margin_0'] ? ' margin-0' : '');
?>
">
<?php
while ($query->have_posts()) {
$query->the_post();
?>
<div class="element <?php
echo esc_attr($instance['effect_id']) . ($instance['is_animate_once'] ? ' once' : '') . ($instance['is_animate'] ? ' animate' : '');
?>
">
<article>
<?php
if (has_post_thumbnail() && !post_password_required()) {
$image = wp_get_attachment_image_src(get_post_thumbnail_id(get_the_ID()), $instance['image_size']);
} else {
$image = sgwindow_get_theme_mod('empty_image');
}
?>
<div class="entry-thumbnail" style="background-image:url('<?php
echo $image[0];
?>
')">
</div>
<div class="hover">
<a href="<?php
echo esc_url(get_permalink());
?>
" class="hover-a">
<header>
<?php
the_title('<h2><a class="entry-title" href="' . esc_url(get_permalink()) . '" rel="bookmark">', '</a></h2>');
?>
<?php
woocommerce_get_template('loop/rating.php');
?>
</header><!-- header -->
<p><?php
sgwindow_the_excerpt();
?>
</p>