本文整理汇总了PHP中theme_get_option函数的典型用法代码示例。如果您正苦于以下问题:PHP theme_get_option函数的具体用法?PHP theme_get_option怎么用?PHP theme_get_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了theme_get_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('CWS_Widget_Video', $instance['title']);
$head = '';
$gen_sets = theme_get_option('general', 'gen_sets');
$yt_color = isset($gen_sets['_yt_color']) ? stripslashes($gen_sets['_yt_color']) : '';
$yt_theme = isset($gen_sets['_yt_theme']) ? stripslashes($gen_sets['_yt_theme']) : '';
$vim_color = isset($gen_sets['_vim_color']) ? stripslashes($gen_sets['_vim_color']) : '';
$vim_title = isset($gen_sets['_vim_header']) ? stripslashes($gen_sets['_vim_header']) : '';
$video_id = isset($instance['video_id']) ? $instance['video_id'] : '';
$v_type = isset($instance['v_type']) ? $instance['v_type'] : '';
$v_width = isset($instance['v_width']) ? $instance['v_width'] : 260;
$v_height = isset($instance['v_height']) ? $instance['v_height'] : 200;
if ($v_type == 'youtube') {
$parser_return = theme_youtube_parser($video_id, $v_width, $v_height, null, $yt_color, $yt_theme);
}
if ($v_type == 'vimeo') {
$parser_return = theme_vimeo_parser($video_id, $v_width, $v_height, null, $vim_color, $vim_title);
}
if ($title && $title != '') {
$head = '<h3 class="widget-title">' . $title . '</h3>';
}
$rand = rand(1, 200);
$v_style = 'style="padding-bottom: ' . ceil($v_height / $v_width * 100) . '%";';
echo $args['before_widget'];
echo $head;
echo '<div class="widget-content"><div class="widget_video">';
echo '<div class="kids_video_wrapper">
<figure ' . $v_style . '>' . $parser_return . '</figure>
</div>
<div class="kids_clear"></div>
</div></div>' . $args['after_widget'];
}
示例2: get_sidebar
function get_sidebar($post_id)
{
if (is_page()) {
$sidebar = $this->sidebar_names['page'];
}
if (is_front_page() || $post_id == theme_get_option('homepage', 'home_page')) {
$sidebar = $this->sidebar_names['home'];
}
if (is_blog()) {
$sidebar = $this->sidebar_names['blog'];
}
if (is_singular('post')) {
$sidebar = $this->sidebar_names['single'];
} elseif (is_singular('portfolio')) {
$sidebar = $this->sidebar_names['portfolio'];
}
if (is_search() || is_archive()) {
$sidebar = $this->sidebar_names['blog'];
}
if (!empty($post_id)) {
$custom = get_post_meta($post_id, '_sidebar', true);
if (!empty($custom)) {
$sidebar = $custom;
}
}
if (isset($sidebar)) {
dynamic_sidebar($sidebar);
}
}
示例3: theme_shortcode_image
/**
* size: small, medium, blog
* icon:zoom, doc, play
*/
function theme_shortcode_image($atts, $content = null, $code)
{
extract(shortcode_atts(array('size' => 'medium', 'link' => '#', 'icon' => false, 'lightbox' => 'false', 'title' => '', 'align' => false, 'group' => '', 'width' => false, 'height' => false, 'autoheight' => 'false', 'quality' => false), $atts));
if (!$width || !$height) {
$width = theme_get_option('image', $size . '_width');
$height = theme_get_option('image', $size . '_height');
if (!$width) {
$width = '150';
}
if (!$height) {
$height = '150';
}
}
if ($autoheight == 'true') {
$height = '';
}
$src = trim($content);
$no_link = '';
if ($lightbox == 'true') {
if ($link == '#') {
$link = $src;
}
} else {
if ($link == '#') {
$no_link = ' image_no_link';
}
}
$content = '<img width="' . $width . '" ' . (empty($height) ? '' : 'height="' . $height . '"') . 'alt="' . $title . '" src="' . THEME_INCLUDES . '/timthumb.php?src=' . get_image_src($src) . (empty($height) ? '' : '&h=' . $height) . '&w=' . $width . '&zc=1' . ($quality ? '&q=' . $quality : '') . '" />';
return '[raw]<span class="image_styled' . ($align ? ' align' . $align : '') . '"><span class="image_frame" style="width:' . $width . 'px;' . (empty($height) ? '' : 'height:' . $height . 'px') . '"><a' . ($group ? ' rel="' . $group . '"' : '') . ' class="image_size_' . $size . $no_link . ($icon ? ' image_icon_' . $icon : '') . ($lightbox == 'true' ? ' lightbox' : '') . '" title="' . $title . '" href="' . $link . '">' . $content . '</a></span><img class="image_shadow" width="' . ($width + 2) . '" src="' . THEME_IMAGES . '/image_shadow.png"/></span>[/raw]';
}
示例4: geo_mashup_locations_exclude_the_categorys
function geo_mashup_locations_exclude_the_categorys($json_object, $object)
{
$exclude = theme_get_option('blog', 'exclude_categorys');
foreach ($json_object['categories'] as $key => $id) {
if (!in_array($id, $exclude)) {
unset($json_object['categories'][$key]);
}
}
return $json_object;
}
示例5: theme_vmenu_widget
function theme_vmenu_widget($args)
{
// for wp < 3.0
extract($args);
$source = theme_get_option('theme_vmenu_source');
echo $before_widget;
echo $before_title . __($source, THEME_NS) . $after_title;
echo theme_get_menu(array('source' => $source, 'depth' => theme_get_option('theme_vmenu_depth'), 'class' => 'art-vmenu'));
echo $after_widget;
}
示例6: theme_add_cufon_script
function theme_add_cufon_script()
{
$fonts = theme_get_option('font', 'fonts');
if (is_array($fonts)) {
foreach ($fonts as $font) {
wp_register_script($font, THEME_FONT_URI . '/' . $font, array('cufon-yui'));
wp_print_scripts($font);
}
}
wp_print_scripts('cufon-yui');
}
示例7: theme_get_image_size
function theme_get_image_size()
{
$customs = theme_get_option('image', 'customs');
$sizes = array("small" => __("Small", 'striking_admin'), "medium" => __("Medium", 'striking_admin'), "large" => __("Large", 'striking_admin'));
if (!empty($customs)) {
$customs = explode(',', $customs);
foreach ($customs as $custom) {
$sizes[$custom] = ucfirst(strtolower($custom));
}
}
return $sizes;
}
示例8: theme_advertisement
function theme_advertisement($atts)
{
extract(shortcode_atts(array('code' => 1, 'align' => 'left', 'inline' => 0), $atts));
$ad = theme_get_option('theme_ad_code_' . $code);
if (!empty($ad)) {
$ad = '<div class="ad align' . esc_attr($align) . '">' . $ad . '</div>';
if (!$inline) {
$ad .= '<div class="cleared"></div>';
}
return $ad;
} else {
return '<p class="error"><strong>[ad]</strong> ' . sprintf(__("Empty ad slot (#%s)!", THEME_NS), esc_attr($code)) . '</p>';
}
}
示例9: get_sidebar_options
function get_sidebar_options()
{
$sidebars = theme_get_option('sidebar', 'sidebars');
if (!empty($sidebars)) {
$sidebars_array = explode(',', $sidebars);
$options = array();
foreach ($sidebars_array as $sidebar) {
$options[$sidebar] = $sidebar;
}
return $options;
} else {
return array();
}
}
示例10: theme_get_dynamic_sidebar_data
function theme_get_dynamic_sidebar_data($sidebar_id)
{
global $theme_widget_args, $theme_sidebars;
$sidebar_style = theme_get_option('theme_sidebars_style_' . $theme_sidebars[$sidebar_id]['group']);
theme_ob_start();
$success = dynamic_sidebar($sidebar_id);
$content = theme_ob_get_clean();
if (!$success) {
return false;
}
extract($theme_widget_args);
$data = explode($after_widget, $content);
$widgets = array();
$heading = theme_get_option('theme_' . (is_home() ? 'posts' : 'single') . '_widget_title_tag');
for ($i = 0; $i < count($data); $i++) {
$widget = $data[$i];
if (theme_is_empty_html($widget)) {
continue;
}
$id = null;
$name = null;
$class = null;
$style = $sidebar_style;
$title = null;
if (preg_match('/<widget(.*?)>/', $widget, $matches)) {
if (preg_match('/id="(.*?)"/', $matches[1], $ids)) {
$id = $ids[1];
}
if (preg_match('/name="(.*?)"/', $matches[1], $names)) {
$name = $names[1];
}
if (preg_match('/class="(.*?)"/', $matches[1], $classes)) {
$class = $classes[1];
}
if ($name) {
$style = theme_get_widget_style($name, $style);
}
$widget = preg_replace('/<widget[^>]+>/', '', $widget);
if (preg_match('/<title>(.*)<\\/title>/', $widget, $matches)) {
$title = $matches[1];
$widget = preg_replace('/<title>.*?<\\/title>/', '', $widget);
}
}
$widgets[] = array('id' => $id, 'name' => $name, 'class' => $class, 'style' => $style, 'title' => $title, 'heading' => $heading, 'content' => $widget);
}
return array_filter($widgets, 'theme_is_displayed_widget');
}
示例11: cws_register_sidebars
/**
* Sidebar Generator.
*
* @package WordPress
* @subpackage Happy Kids
* @since Happy Kids 1.0
* @version 3.2.9
*/
function cws_register_sidebars()
{
$gen_sets = theme_get_option('general', 'gen_sets');
$custom_sidebars = isset($gen_sets['_sidebars_list']) ? $gen_sets['_sidebars_list'] : '';
if (function_exists('register_sidebars')) {
register_sidebar(array('name' => 'Right Sidebar', 'id' => 'sidebar-1', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
register_sidebar(array('name' => 'Left Sidebar', 'id' => 'sidebar-2', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
register_sidebar(array('name' => 'Footer', 'id' => 'sidebar-3', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
if (!empty($custom_sidebars)) {
$sidebars_arr = explode("|", $custom_sidebars);
$i = 3;
foreach ($sidebars_arr as $sidebar) {
$i++;
if (function_exists('register_sidebar')) {
register_sidebar(array('name' => $sidebar, 'id' => 'sidebar-' . $i, 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>'));
}
}
}
}
}
示例12: multitranslate
function multitranslate($text = null, $id = null, $echo = true)
{
$gen_sets = theme_get_option('general', 'gen_sets');
if ($text && $id) {
$option = isset($gen_sets[$id]) ? $gen_sets[$id] : '';
if ($option) {
if (!$echo) {
return $option;
} else {
echo $option;
}
} else {
if (!$echo) {
return $text;
} else {
echo $text;
}
}
}
}
示例13: theme_exclude_the_categorys
function theme_exclude_the_categorys($thelist, $separator = ' ')
{
if (!defined('WP_ADMIN') && !isset($_GET['geo_mashup_content'])) {
//Category IDs to exclude
$exclude = theme_get_option('blog', 'exclude_categorys');
$exclude2 = array();
foreach ($exclude as $c) {
$exclude2[] = get_cat_name($c);
}
$cats = explode($separator, $thelist);
$newlist = array();
foreach ($cats as $cat) {
$catname = trim(strip_tags($cat));
if (!in_array($catname, $exclude2)) {
$newlist[] = $cat;
}
}
return implode($separator, $newlist);
} else {
return $thelist;
}
}
示例14: sitemap_portfolios
function sitemap_portfolios($atts)
{
extract(shortcode_atts(array('show_comment' => false, 'number' => '0', 'cat' => ''), $atts));
if ($number == 0) {
$number = 1000;
}
if ($show_comment === 'true' && theme_get_option('portfolio', 'enable_comment')) {
$show_comment = true;
}
$query = array('showposts' => (int) $number, 'post_type' => 'portfolio');
if ($cat) {
$query['taxonomy'] = 'portfolio_category';
$query['term'] = $cat;
}
query_posts($query);
$output = '';
while (have_posts()) {
the_post();
$output .= '<li><a href="' . get_permalink() . '" rel="bookmark" title="' . sprintf(__("Permanent Link to %s", 'striking_front'), get_the_title()) . '">' . get_the_title() . '</a>' . ($show_comment ? ' (' . get_comments_number() . ')' : '') . '</li>';
}
wp_reset_query();
return '<ul>' . $output . '</ul>';
}
示例15: get_header
/**
* The Template for displaying product archives, including the main shop page which is a post type archive.
*
* Override this template by copying it to yourtheme/woocommerce/archive-product.php
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 2.0.0
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
get_header();
$gen_sets = theme_get_option('general', 'gen_sets');
$woo_template = isset($gen_sets['_gen_woo_template_select']) ? $gen_sets['_gen_woo_template_select'] : '';
$gen_side_r = isset($gen_sets['_sidebar_main_woo_r']) ? $gen_sets['_sidebar_main_woo_r'] : false;
$gen_side_l = isset($gen_sets['_sidebar_main_woo_l']) ? $gen_sets['_sidebar_main_woo_l'] : false;
$show_slider = isset($gen_sets['_gen_slider_select']) ? $gen_sets['_gen_slider_select'] : '';
$slogan_sidebar = isset($gen_sets['slogan-area']) ? $gen_sets['slogan-area'] : '';
$benefits_sidebar = isset($gen_sets['benefits-area']) ? $gen_sets['benefits-area'] : '';
$page_custom = theme_get_post_custom();
$page_crumbs = isset($gen_sets['_gen_breadcrumbs']) ? $gen_sets['_gen_breadcrumbs'] : 'show';
switch ($woo_template) {
case 'sb_right':
case 'sb_left':
$woo_style = "single-sidebar";
break;
case 'sb_double':
$woo_style = "double-sidebar";