本文整理汇总了PHP中theme_option函数的典型用法代码示例。如果您正苦于以下问题:PHP theme_option函数的具体用法?PHP theme_option怎么用?PHP theme_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了theme_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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'];
}
示例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>';
}
}
示例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
}
示例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;
}
示例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));
示例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>
示例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');
?>
//.........这里部分代码省略.........
示例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
示例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>
示例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
}
?>
示例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
示例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
}
示例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>
示例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();
示例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 . "...";
}
}