本文整理汇总了PHP中theme_option函数的典型用法代码示例。如果您正苦于以下问题:PHP theme_option函数的具体用法?PHP theme_option怎么用?PHP theme_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了theme_option函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: widget
public function widget($args, $instance)
{
if (!array_key_exists('title', $instance)) {
$instance['title'] = '';
}
$title = apply_filters('widget_title', $instance['title']);
// before and after widget arguments are defined by themes
echo $args['before_widget'];
if (!empty($title)) {
echo $args['before_title'] . $title . $args['after_title'];
}
// This is where you run the code and display the output
?>
<?php
$social_icons = laboutique_social_icons(array('class' => 'social_icons'));
?>
<?php
if ($social_icons) {
?>
<!-- Social icons -->
<div class="social_icons">
<h6><?php
echo theme_option('social_title');
?>
</h6>
<?php
echo $social_icons;
?>
</div>
<?php
}
?>
<?php
echo $args['after_widget'];
}
开发者ID:ravenvn,项目名称:sandau,代码行数:35,代码来源:widget-social.php
示例2: actionCall
/**
* Adds action calls
*
* @since PressWork 1.0
*/
function actionCall($id)
{
if (theme_option('guides') == "on" && current_user_can('manage_options')) {
echo '<div class="guides clear fl"><p class="guide-title">' . $id . '</p>';
}
do_action($id);
if (theme_option('guides') == "on" && current_user_can('manage_options')) {
echo '</div>';
}
}
开发者ID:Runemester,项目名称:PressWork,代码行数:15,代码来源:action-blocks.php
示例3: pw_footer_content
function pw_footer_content()
{
?>
<ul id="footer" class="fl clear">
<?php
$layout = theme_option('footer_option');
$layout = explode(",", $layout);
foreach ($layout as $elem) {
pw_get_element($elem);
}
?>
</ul> <!-- end #footer -->
<?php
}
开发者ID:Runemester,项目名称:PressWork,代码行数:14,代码来源:actions.php
示例4: pw_fullWidth
/**
* Adds the fullwidth class to the body tag
*
* @since PressWork 1.0
*/
function pw_fullWidth($classes = '')
{
global $post;
$added = '';
if (!empty($post)) {
$full = get_post_meta($post->ID, 'pw_single_layout', true);
if ($full == 2 && is_singular()) {
$classes[] = 'fullwidth';
$added = true;
}
}
if (theme_option('layout_option') == "maincontent" && empty($added)) {
$classes[] = 'fullwidth';
}
return $classes;
}
开发者ID:Runemester,项目名称:PressWork,代码行数:21,代码来源:fullwidth.php
示例5:
<div class="span4">
<div class="row-fluid">
<div class="<?php
if (theme_option('header_bar_search_publish')) {
?>
span8 offset2<?php
} else {
?>
span10<?php
}
?>
">
<?php
if (theme_option('header_bar_search_publish')) {
?>
<!-- Search -->
<div class="search">
<div class="qs_s">
<form method="get" action="<?php
echo home_url();
?>
" role="search">
<input type="text" name="s" id="query" placeholder="<?php
echo esc_attr(__('Search', DOMAIN));
?>
…" autocomplete="off" value="">
<input type="submit" value="<?php
echo esc_attr(__('Search', DOMAIN));
开发者ID:ravenvn,项目名称:sandau,代码行数:30,代码来源:header.php
示例6: the_author_posts_link
echo ' ';
the_author_posts_link();
}
?>
</div>
<div class="storycontent">
<?php
if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
echo '<a href="' . get_permalink() . '">';
the_post_thumbnail('thumbnail', array('class' => 'alignleft'));
echo '</a>';
} else {
echo resize(get_option('thumbnail_size_w'), get_option('thumbnail_size_h'));
}
if (theme_option('excerpt_content') == '2') {
theme_content(__('Read more »', "magazine-basic"));
} else {
theme_excerpt(theme_option('excerpt_two'));
}
?>
</div>
</div>
<?php
$x++;
}
}
?>
</div>
开发者ID:JustinHop,项目名称:fya,代码行数:30,代码来源:option2.php
示例7: pw_header_css
function pw_header_css()
{
global $pw_content_width, $pw_first_sidebar, $pw_second_sidebar, $pw_body_margins, $pw_margins, $pw_site;
$fullsite = $pw_site;
$loc2 = strpos(theme_option('layout_option'), "secondsidebar");
$loc = strpos(theme_option('layout_option'), "firstsidebar");
$mainlineheight = round(theme_option('main_size') * 1.4);
$right_col_padding = get_option('thumbnail_size_w') + 15;
?>
<!-- PressWork Theme Option CSS -->
<style type="text/css"<?php
if (theme_option('toolbox') == "on" && current_user_can("manage_options")) {
echo ' id="pw_style_preview"';
}
?>
>
body { font-family: <?php
echo theme_option("body_font");
?>
; font-size: <?php
echo theme_option("body_font_size");
?>
px; }
h1, h2, h3, h4, h5, h6, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a { font-family: <?php
echo theme_option("headers_font");
?>
; }
#body-wrapper { color: <?php
echo theme_option('main_text_color');
?>
; width: <?php
echo $pw_site;
?>
px; padding: <?php
echo $pw_body_margins;
?>
px; background-color: <?php
echo theme_option('page_background_color');
?>
; }
#main-wrapper > li { margin: 0 <?php
echo $pw_margins / 2;
?>
px; }
#firstsidebar { width: <?php
echo $pw_first_sidebar;
?>
px; }
#secondsidebar { width: <?php
echo $pw_second_sidebar;
?>
px; }
#maincontent { width: <?php
echo $pw_content_width;
?>
px; }
body.fullwidth #maincontent { width: <?php
echo $fullsite;
?>
px; margin: 0; }
.siteheader a { color: <?php
echo theme_option('siteheader_color');
?>
; }
.siteheader a:hover { color: <?php
echo theme_option('siteheader_color_hover');
?>
; }
#description { color: <?php
echo theme_option('description_color');
?>
; }
a { color: <?php
echo theme_option('a_color');
?>
; background: <?php
echo theme_option('a_background_color');
?>
}
a:hover { color: <?php
echo theme_option('a_color_hover');
?>
; background: <?php
echo theme_option('a_background_color_hover');
?>
}
#nav nav ul { background: <?php
echo theme_option('nav_background_color');
?>
; }
#nav nav a { color: <?php
echo theme_option('nav_color');
?>
}
#nav nav a:hover, #nav .sub-menu li, #nav .sfHover { color: <?php
echo theme_option('nav_color_hover');
?>
; background: <?php
echo theme_option('nav_background_color_hover');
?>
//.........这里部分代码省略.........
开发者ID:Runemester,项目名称:PressWork,代码行数:101,代码来源:stylesheet.php
示例8: _e
<p><?php
_e('Thank you. Your order has been received.', 'woocommerce');
?>
</p>
<?php
}
?>
</div><!-- #content -->
</div>
</div>
<?php
if (!trim(theme_option('staticpages_sidebar'))) {
?>
<div class="span3 hidden-desktop visible-phone visible-tablet">
<?php
if (is_user_logged_in()) {
?>
<?php
laboutique_my_account_sidebar_nav(array('class' => 'nav nav-tabs nav-stacked'));
?>
<?php
} else {
?>
<?php
wp_nav_menu(array('theme_location' => 'pages_sidebar', 'menu_class' => 'nav nav-tabs nav-stacked', 'fallback_cb' => 'false'));
?>
<?php
开发者ID:ravenvn,项目名称:sandau,代码行数:30,代码来源:thankyou.php
示例9: get_post_meta
echo $product->get_title();
?>
</a></h6>
<div class="price">
<?php
if ($price = $product->get_price_html()) {
echo '<div class="price">';
echo $price;
$sale = get_post_meta($product->id, '_sale_price', true);
if ($sale) {
echo '<span class="label label-sale">' . __("Sale") . '</span>';
}
echo '</div>';
}
if (!theme_option('shop_disable_reviews')) {
if ($product->get_average_rating()) {
echo '<div class="rating rating-' . (int) $product->get_average_rating() . '">';
for ($i = 1; $i <= (int) $product->get_average_rating(); $i++) {
echo '<i class="icon-heart"></i>' . "\n";
}
echo '</div>';
} else {
echo '<div class="rating rating-0">
<a href="' . esc_url(get_permalink()) . '#tab-reviews">' . __("No reviews — be the first?", DOMAIN) . '</a>
</div>';
}
}
?>
</div>
</div>
开发者ID:ravenvn,项目名称:sandau,代码行数:31,代码来源:content-widget-product.php
示例10: woocommerce_get_template
<?php
woocommerce_get_template('loop/no-products-found.php');
?>
<?php
}
?>
</div><!-- #content -->
</div><!-- #primary -->
</div>
<?php
if (theme_option('shop_sidebar') == 'right') {
?>
<div class="span3">
<!-- Sidebar -->
<?php
dynamic_sidebar('sidebar-3');
?>
<!-- End sidebar -->
</div>
<?php
}
?>
开发者ID:ravenvn,项目名称:sandau,代码行数:30,代码来源:archive-product.php
示例11: _e
<h2><?php
_e('Tags', "feed-me-seymour");
?>
</h2>
<ul>
<li><?php
wp_tag_cloud();
?>
</li>
</ul>
</div>
<?php
}
?>
<?php
if (theme_option('logo_location') == "aligncenter" && theme_option('rss_button') != 2) {
?>
<div class="sidebox">
<a href="<?php
bloginfo('rss2_url');
?>
"><img src="<?php
echo THEME_URL;
?>
/images/rss.png" alt="<?php
_e('Subscribe to RSS', "feed-me-seymour");
?>
" /></a><p><a href="<?php
bloginfo('rss2_url');
?>
"><?php
开发者ID:kosir,项目名称:thatcamp-org,代码行数:31,代码来源:sidebar.php
示例12: pw_columns
/**
* Add pw_columns functionality
*
* Display posts in a grid layout according to the parameters set in the
* argument array.
*
* @since PressWork 1.0
*/
function pw_columns($args = '')
{
global $pw_content_width;
$defaults = array('width' => 'full', 'columns' => 1, 'posts' => 1, 'text' => 'excerpt', 'readmore' => 1, 'category' => 'all', 'dates' => 1, 'authors' => 1, 'comments' => 1, 'images' => 1, 'img_w' => 100, 'img_h' => 100, 'margin-right' => '', 'offset' => '', 'title' => '', 'id' => '', 'padding' => 15, 'colmargin' => 30);
$r = wp_parse_args($args, $defaults);
extract($r, EXTR_SKIP);
$featuredcat = theme_option('fp_featured');
$posts = array("posts_per_page" => $r['posts']);
if ($r['category'] != "all") {
$posts['cat'] = $r['category'];
}
if (isset($r['offset'])) {
$posts['offset'] = $r['offset'];
}
$column = new WP_Query();
$column->query($posts);
if ($r['width'] == "full") {
$width = ' style="width:100%; margin-right:' . $r['margin-right'] . 'px;"';
if ($r['columns'] != 1) {
$col_width = ($pw_content_width - $padding * 2 * $columns - $colmargin * ($columns - 1)) / $r['columns'];
} else {
$col_width = $pw_content_width - $padding * 2;
}
$col_width = ' style="width: ' . $col_width . 'px;';
} else {
$width = ' style="width:' . $r['width'] . 'px; margin-right:' . $r['margin-right'] . 'px;"';
if ($r['columns'] != 1) {
$col_width = ($r['width'] - $padding * 2 * $columns - $colmargin * ($columns - 1)) / $r['columns'];
} else {
$col_width = $r['width'] - $padding * 2;
}
$col_width = ' style="width: ' . $col_width . 'px;';
}
$x = 1;
if (!empty($r['id'])) {
$id = ' id="' . $r['id'] . '"';
} else {
$id = "";
}
?>
<div class="columns"<?php
echo $width;
echo $id;
?>
>
<?php
if (!empty($r['title'])) {
echo '<div class="columns-title">' . $r['title'] . '</div>';
}
?>
<?php
while ($column->have_posts()) {
$column->the_post();
?>
<?php
if ($x == 1) {
$clear = "clear";
} else {
$clear = "";
}
?>
<?php
if ($x != 1 && $r['columns'] > 1) {
$final_width = $col_width . ' margin-left: ' . $colmargin . 'px;"';
} else {
$final_width = $col_width . '"';
}
?>
<?php
if ($x == $r['columns']) {
$x = 0;
}
?>
<div id="post-<?php
the_ID();
?>
" <?php
post_class($clear);
echo $final_width;
?>
>
<?php
actionBlock('pw_columns', $r);
?>
</div>
<?php
$x++;
}
?>
</div>
<?php
}
开发者ID:Runemester,项目名称:PressWork,代码行数:100,代码来源:columns.php
示例13: get_permalink
}
?>
</div>
<div class="storycontent">
<?php
if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
echo '<a href="' . get_permalink() . '">';
the_post_thumbnail('thumbnail', array('class' => 'alignleft'));
echo '</a>';
} else {
echo resize(get_option('thumbnail_size_w'), get_option('thumbnail_size_h'));
}
if (theme_option('excerpt_content') == '2') {
theme_content(__('Read more »', "magazine-basic"));
} else {
theme_excerpt(theme_option('excerpt_three'));
}
?>
</div>
</div>
<?php
$x++;
}
}
if ($x > 4) {
echo "</div>";
}
?>
</div>
开发者ID:JustinHop,项目名称:fya,代码行数:30,代码来源:option3.php
示例14: get_header
<?php
get_header();
?>
<?php
$layout = theme_option('layout_option');
$fullwidth = get_post_meta($post->ID, 'pw_single_layout', true);
if ($fullwidth == 2) {
$layout = "maincontent";
}
$layout = explode(",", $layout);
foreach ($layout as $elem) {
pw_get_element($elem);
}
get_footer();
开发者ID:Runemester,项目名称:PressWork,代码行数:15,代码来源:index.php
示例15: metaDesc
function metaDesc()
{
$content = strip_tags(get_the_content());
if ($content) {
$content = preg_replace('/\\[.+\\]/', '', $content);
$content = ereg_replace("[\n\r]", "\t", $content);
$content = ereg_replace("\t\t+", " ", $content);
$content = htmlentities($content);
} else {
$content = htmlentities(theme_option('site_description'));
}
if (strlen($content) < 155) {
echo $content;
} else {
$desc = substr($content, 0, 155);
echo $desc . "...";
}
}
开发者ID:JustinHop,项目名称:fya,代码行数:18,代码来源:functions.php
示例16: printf
printf(__("Permanent Link to %s", "magazine-basic"), the_title_attribute('echo=0'));
?>
"><?php
the_title();
?>
</a></h2>
<div class="meta">
<?php
if (theme_option('dates_cats') == 'on') {
echo '<div class="date">';
the_time(get_option('date_format'));
echo '</div>';
}
?>
<?php
if (theme_option('authors_cats') == 'on') {
_e("By", "magazine-basic");
echo ' ';
the_author_posts_link();
}
?>
</div>
<div class="storycontent">
<?php
if (function_exists('has_post_thumbnail') && has_post_thumbnail()) {
echo '<a href="' . get_permalink() . '">';
the_post_thumbnail('thumbnail', array('class' => 'alignleft'));
echo '</a>';
} else {
echo resize(get_option('thumbnail_size_w'), get_option('thumbnail_size_h'));
开发者ID:JustinHop,项目名称:fya,代码行数:31,代码来源:search.php
示例17: footer_scripts
/**
* These are the jQuery scripts needed to run PressWork
* so don't mess with this file
*
* @since PressWork 1.0
*/
function footer_scripts()
{
?>
<script type="text/javascript" src="<?php
echo admin_url("js/farbtastic.js");
?>
"></script>
<script type="text/javascript">
/* <![CDATA[ */
jQuery.fn.blindToggle = function(speed, easing, callback) {
return this.animate({left: parseInt(this.css('left')) <0 ? 0 : -700}, speed, easing, callback);
};
(function($) {
<?php
global $pw_welcome;
if ($_GET['action'] == "pw-activate" && empty($pw_welcome)) {
?>
$("#close-welcome").click(function() {
nonce = $("input#bavotasan_nonce").val();
var data = {
nonce: nonce,
action: 'remove_welcome_screen'
};
$.post('<?php
echo admin_url('admin-ajax.php');
?>
', data,
function(response){
$("#pw_welcome_screen, #pw_fadeback").fadeOut("slow",
function() {
window.location = "<?php
echo home_url("/");
?>
";
});
});
});
$(document).ready(function() {
var pos = $("#wp-admin-bar-presswork-options").position();
$(".adminbar-arrow").css({ left: pos.left-30 }).show();
});
<?php
}
?>
$("#savetheme").click(function() {
$("#themeform").trigger("submit");
return false;
});
$("#themeform").submit(function() {
nonce = $("input#bavotasan_nonce").val();
var loader = $("#ajaxloader");
var message = $("#save_message");
message.hide();
loader.show();
var data = {
action: 'save_theme_options',
nonce: nonce,
option: $(this).serialize(),
};
$.post('<?php
echo admin_url('admin-ajax.php');
?>
', data,
function(response){
loader.hide();
message.fadeIn();
setTimeout(function() { message.fadeOut(); }, 5000);
});
return false;
});
$("#colorselect").change(function() {
colorselect();
});
$("#layoutselect").change(function() {
layoutselect();
});
$(".fontselect").change(function() {
$("#"+ name + "_preview").remove();
var font = $(this).val();
var el = $(this).attr("rel");
var name = $(this).attr("name");
var addplus = font.replace(" ", "+");
$("head").prepend("<link id='" + name + "_preview' href='http://fonts.googleapis.com/css?family=" + addplus + "' rel='stylesheet' type='text/css'>");
$(el).css({ fontFamily : font });
});
$(".logo-input input").change(function() {
var thesrc = $(this).val();
$("#header_logo img").attr("src", thesrc);
//.........这里部分代码省略.........
开发者ID:Runemester,项目名称:PressWork,代码行数:101,代码来源:footer-scripts.php
示例18: bloginfo
?>
</a>
</div>
<?php
}
?>
<div id="description"<?php
echo $float;
?>
>
<?php
if (theme_option('tag_line') != 2) {
bloginfo('description');
}
?>
</div>
</div>
<!-- end header -->
<div id="mainwrapper">
<?php
$loc = theme_option('sidebar_location');
if ($loc == 1 || $loc == 3 || $loc == 5) {
get_sidebar();
// calling the First Sidebar
}
if ($loc == 3) {
get_sidebar("second");
}
?>
<div id="leftcontent">
开发者ID:kosir,项目名称:thatcamp-org,代码行数:31,代码来源:header.php
示例19: do_action
* @version 1.6.4
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
global $post, $product;
?>
<div class="product_meta meta">
<?php
do_action('woocommerce_product_meta_start');
?>
<?php
if (theme_option('shop_sku') && $product->get_sku()) {
?>
<div itemprop="productID" class="sku_wrapper sku"><i class="icon-pencil"></i>
<span rel="tooltip" title="SKU is <?php
echo $product->get_sku();
?>
"><?php
echo $product->get_sku();
?>
</span>
</div>
<?php
}
?>
开发者ID:ravenvn,项目名称:sandau,代码行数:30,代码来源:meta.php
示例20: body_class
<body class="<?php
echo body_class();
?>
">
<div class="main">
<header class="header">
<div class="header__wrapper">
<a class="header__logo" href="<?php
echo base_url();
?>
">
<?php
if (theme_option('header_logo')) {
?>
<img src="<?php
echo theme_option('logo_src');
?>
">
<?php
} else {
?>
<?php
echo site_name();
?>
<?php
}
?>
</a>
<?php
theme_include('partials/navigation');
?>
开发者ID:CraigChilds94,项目名称:anchor-zap,代码行数:31,代码来源:header.php
注:本文中的theme_option函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论