本文整理汇总了PHP中sq_option函数的典型用法代码示例。如果您正苦于以下问题:PHP sq_option函数的具体用法?PHP sq_option怎么用?PHP sq_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sq_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: kleo_bbpress_change_layout
function kleo_bbpress_change_layout($layout)
{
if (is_bbpress()) {
$bbpress_template = sq_option('bbpress_sidebar', 'default');
if ($bbpress_template != 'default') {
$layout = $bbpress_template;
}
}
return $layout;
}
示例2: setup_portfolio_post_type
/**
* Setup Portfolio post type
* @since 1.5
* @return void
*/
public function setup_portfolio_post_type()
{
$has_archive = sq_option('portfolio_custom_archive', '0') == '1' ? FALSE : TRUE;
/* Default WordPress post archive page */
if ($has_archive) {
$slug = sq_option('portfolio_slug', 'portfolio');
$slug = apply_filters('kleo_portfolio_slug', $slug);
} else {
$page_id = sq_option('portfolio_page');
$page = get_post($page_id);
$slug = $page->post_name;
}
$args = array('labels' => $this->get_labels('portfolio', $this->labels['portfolio']['singular'], $this->labels['portfolio']['plural'], $this->labels['portfolio']['menu']), 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => TRUE, 'menu_icon' => 'dashicons-format-image', 'query_var' => true, 'rewrite' => array('slug' => esc_attr($slug), 'feeds' => true, 'with_front' => false), 'has_archive' => $has_archive, 'hierarchical' => false, 'menu_position' => 20, 'supports' => array('title', 'editor', 'thumbnail', 'excerpt', 'comments'));
register_post_type('portfolio', $args);
register_taxonomy_for_object_type('post_tag', 'portfolio');
$args = array("label" => _x('Portfolio Categories', 'category label', "kleo_framework"), "singular_label" => _x('Portfolio Category', 'category singular label', "kleo_framework"), 'public' => true, 'hierarchical' => true, 'show_ui' => true, 'show_in_nav_menus' => false, 'args' => array('orderby' => 'term_order'), 'rewrite' => array('slug' => apply_filters('kleo_portfolio_cat_slug', 'portfolio-category'), 'with_front' => false, 'hierarchical' => true), 'query_var' => true);
register_taxonomy('portfolio-category', 'portfolio', $args);
}
示例3: kleo_bp_change_layout
function kleo_bp_change_layout($layout)
{
global $bp;
if (!bp_is_blog_page()) {
$layout = sq_option('bp_layout', 'right');
//profile page
if (sq_option('bp_layout_profile', 'default') != 'default' && bp_is_user()) {
$layout = sq_option('bp_layout_profile', 'right');
} elseif (sq_option('bp_layout_members_dir', 'default') != 'default' && bp_is_current_component($bp->members->slug) && bp_is_directory()) {
$layout = sq_option('bp_layout_members_dir', 'right');
} elseif (sq_option('bp_layout_groups', 'default') != 'default' && bp_is_current_component($bp->groups->slug)) {
$layout = sq_option('bp_layout_groups', 'right');
} elseif (sq_option('bp_layout_activity', 'default') != 'default' && bp_is_current_component($bp->activity->slug)) {
$layout = sq_option('bp_layout_activity', 'right');
} elseif (sq_option('bp_layout_register', 'default') != 'default' && bp_is_register_page()) {
$layout = sq_option('bp_layout_register', 'right');
}
}
return $layout;
}
示例4: kleo_woo_dynamic_css
function kleo_woo_dynamic_css()
{
$h1 = sq_option('font_h1');
$extra_style = '';
$extra_style .= '.percentage-badge { color: ' . sq_option('woo_percent_color', '#fff') . ' !important; background: ' . sq_option('woo_percent_bg', '#000') . ' !important; }';
$extra_style .= 'body.single-product span.page-title { font-family: ' . $h1['font-family'] . ' !important; font-weight: ' . $h1['font-weight'] . ' !important; display:block; font-size: 26px; line-height: 34px; margin: 0; }';
return $extra_style;
}
示例5: sq_option
//Specific class for post listing */
$blog_type = sq_option('blog_type', 'masonry');
$template_classes = $blog_type . '-listing';
if ($blog_type == 'standard' && sq_option('blog_meta_status', 1) == 1) {
$template_classes .= ' with-meta';
}
add_filter('kleo_main_template_classes', create_function('$cls', '$cls .=" posts-listing ' . $template_classes . '"; return $cls;'));
/***************************************************
:: Title section
***************************************************/
if (sq_option('title_location', 'breadcrumb') == 'main') {
$title_arr['show_title'] = false;
} else {
$title_arr['title'] = kleo_title();
}
if (sq_option('breadcrumb_status', 1) == 0) {
$title_arr['show_breadcrumb'] = false;
}
echo kleo_title_section($title_arr);
?>
<?php
get_template_part('page-parts/general-before-wrap');
?>
<?php
if (have_posts()) {
if ($blog_type == 'masonry') {
?>
示例6: kleo_ajax_login
function kleo_ajax_login()
{
/* If not our action, bail out */
if (!isset($_POST['action']) || isset($_POST['action']) && $_POST['action'] != 'kleoajaxlogin') {
return false;
}
/* If user is already logged in print a specific message */
if (is_user_logged_in()) {
$link = "javascript:window.location.reload();return false;";
echo json_encode(array('loggedin' => false, 'message' => '<i class="icon icon-info-circled"></i> ' . sprintf(__('You are already logged in. Please <a href="#" onclick="%s">refresh</a> page', 'kleo_framework'), $link)));
die;
}
// Check the nonce, if it fails the function will break
check_ajax_referer('kleo-ajax-login-nonce', 'security');
// Nonce is checked, continue
$secure_cookie = '';
// If the user wants ssl but the session is not ssl, force a secure cookie.
if (!empty($_POST['log']) && !force_ssl_admin()) {
$user_name = sanitize_user($_POST['log']);
if ($user = get_user_by('login', $user_name)) {
if (get_user_option('use_ssl', $user->ID)) {
$secure_cookie = true;
force_ssl_admin(true);
}
}
}
if (isset($_REQUEST['redirect_to'])) {
$redirect_to = $_REQUEST['redirect_to'];
// Redirect to https if user wants ssl
if ($secure_cookie && false !== strpos($redirect_to, 'wp-admin')) {
$redirect_to = preg_replace('|^http://|', 'https://', $redirect_to);
}
} else {
$redirect_to = '';
}
$user_signon = wp_signon('', $secure_cookie);
if (is_wp_error($user_signon)) {
$error_msg = $user_signon->get_error_message();
echo json_encode(array('loggedin' => false, 'message' => '<span class="wrong-response"><i class="icon icon-attention"></i> ' . $error_msg . '</span>'));
//echo json_encode(array( 'loggedin' => false, 'message' => '<span class="wrong-response"><i class="icon icon-attention"></i> ' . __( 'Wrong username or password. Please try again.', 'kleo_framework' ) . '</span>' ));
} else {
if (sq_option('login_redirect', 'default') == 'reload') {
$redirecturl = NULL;
} else {
$requested_redirect_to = isset($_REQUEST['redirect_to']) ? $_REQUEST['redirect_to'] : '';
/**
* Filter the login redirect URL.
*
* @since 3.0.0
*
* @param string $redirect_to The redirect destination URL.
* @param string $requested_redirect_to The requested redirect destination URL passed as a parameter.
* @param WP_User|WP_Error $user WP_User object if login was successful, WP_Error object otherwise.
*/
$redirecturl = apply_filters('login_redirect', $redirect_to, $requested_redirect_to, $user_signon);
}
echo json_encode(array('loggedin' => true, 'redirecturl' => $redirecturl, 'message' => '<span class="good-response"><i class="icon icon-ok-circled"></i> ' . __('Login successful, redirecting...', 'kleo_framework') . '</span>'));
}
die;
}
示例7: kleo_memberships
"><?php
echo $pmpro_msg;
?>
</div>
<?php
}
?>
<div class="row membership pricing-table">
<?php
$restrict_options = kleo_memberships();
$pmpro_levels = array_filter($pmpro_levels);
$levelsno = count($pmpro_levels);
$levelsno = $levelsno == 0 ? 1 : $levelsno;
$level_cols = 12 / $levelsno;
$newoptions = sq_option('membership');
$popular = $newoptions['kleo_membership_popular'];
$kleo_pmpro_levels_order = isset($newoptions['kleo_pmpro_levels_order']) ? $newoptions['kleo_pmpro_levels_order'] : NULL;
switch ($level_cols) {
case "1":
$level_cols = "1";
break;
case "2":
$level_cols = "2";
break;
case "3":
$level_cols = "3";
break;
case "4":
$level_cols = "4";
break;
示例8: while
<div id="buddypress">
<?php
if (bp_has_groups()) {
while (bp_groups()) {
bp_the_group();
?>
<?php
do_action('bp_before_group_home_content');
?>
<div class="row">
<?php
if (sq_option('bp_full_group', 0) == 0) {
?>
<div class="col-sm-12">
<div id="item-header" role="complementary">
<?php
bp_get_template_part('groups/single/group-header');
?>
</div><!-- #item-header -->
</div>
<?php
}
?>
<div class="col-sm-12">
<div id="item-nav">
<div class="item-list-tabs no-ajax" id="object-nav" role="navigation">
示例9: get_template_part
<?php
get_template_part('content', get_post_format());
?>
<?php
get_template_part('page-parts/posts-social-share');
?>
<?php
if ($related == 1) {
get_template_part('page-parts/posts-related');
}
?>
<?php
if (sq_option('post_navigation', 1) == 1) {
// Previous/next post navigation.
kleo_post_nav();
}
?>
<!-- Begin Comments -->
<?php
comments_template('', true);
?>
<!-- End Comments -->
<?php
}
?>
示例10: sq_option_url
<?php
/**
* Header section of our theme
*
* Displays all of the <div id="header"> section
*
* @package WordPress
* @subpackage Kleo
* @since Kleo 1.0
*/
//set logo path
$logo_path = sq_option_url('logo');
$logo_path = apply_filters('kleo_logo', $logo_path);
$social_icons = apply_filters('kleo_show_social_icons', sq_option('show_social_icons', 1));
$top_bar = sq_option('show_top_bar', 1);
$top_bar = apply_filters('kleo_show_top_bar', $top_bar);
global $current_user;
?>
<div id="header" class="header-color">
<div class="navbar" role="navigation">
<?php
if ($top_bar == 1) {
//top bar enabled
?>
<!--Attributes-->
<!--class = social-header inverse-->
示例11:
}
//hide title?
$title_arr['show_title'] = true;
if (is_singular() && get_cfield('title_checkbox') == 1) {
$title_arr['show_title'] = false;
}
//If we are displaying the title in the main area, not the breadcrumb area
if (sq_option('title_location', 'breadcrumb') == 'main') {
$title_arr['show_title'] = false;
}
//hide breadcrumb?
$title_arr['show_breadcrumb'] = true;
if (sq_option('breadcrumb_status', 1) == 0) {
$title_arr['show_breadcrumb'] = false;
}
if (is_singular()) {
if (get_cfield('hide_breadcrumb') == 1) {
$title_arr['show_breadcrumb'] = false;
} else {
if (get_cfield('hide_breadcrumb') === '0') {
$title_arr['show_breadcrumb'] = true;
}
}
}
//extra info
if (is_singular() && get_cfield('hide_info') == 1 || sq_option('title_info', '') == '') {
$title_arr['extra'] = '';
}
if (isset($title_arr['show_breadcrumb']) && $title_arr['show_breadcrumb'] || !isset($title_arr['extra']) || $title_arr['show_title']) {
echo kleo_title_section($title_arr);
}
示例12: do_action
<div id="featured-content" class="featured-content">
<?php
/**
* Fires before the featured content.
*
* @since Kleo 1.0
*/
do_action('kleo_featured_posts_before');
echo $before_featured;
$featured_posts = kleo_get_featured_posts();
foreach ((array) $featured_posts as $order => $post) {
setup_postdata($post);
// Include the featured content template.
if ('grid' == sq_option('featured_content_layout', 'carousel')) {
get_template_part('page-parts/post-content-masonry');
} else {
get_template_part('page-parts/post-content-carousel');
}
}
echo $after_featured;
/**
* Fires after the Kleo featured content.
*
* @since Kleo 1.0
*/
do_action('kleo_featured_posts_after');
wp_reset_postdata();
?>
</div><!-- #featured-content .featured-content -->
示例13: foreach
.alternate-color .masonry-listing .post-content {
background-color: #fff;
}
<?php
}
}
/* Body Background */
if (sq_option('site_style') == 'boxed') {
echo $kleo_theme->get_bg_css('body_bg', 'body');
}
/* Sections background */
foreach ($style_sets as $set) {
if ($set == 'header') {
$element = '.' . $set . '-color, .' . $set . '-color .kleo-main-header';
} else {
$element = '.' . $set . '-color';
}
echo $kleo_theme->get_bg_css('st__' . $set . '__bg_image', $element);
}
if (sq_option('menu_size', '') != '') {
echo '.kleo-main-header .navbar-nav > li > a { font-size: ' . sq_option('menu_size', '') . 'px; }';
}
//here you can apply other styles
$extra_output = apply_filters('kleo_add_dynamic_style', '');
echo $extra_output;
示例14: WC
* @version 1.6.4
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
global $product, $woocommerce, $woocommerce_loop;
$crosssells = WC()->cart->get_cross_sells();
if (sizeof($crosssells) == 0) {
return;
}
$meta_query = WC()->query->get_meta_query();
$args = array('post_type' => 'product', 'ignore_sticky_posts' => 1, 'no_found_rows' => 1, 'posts_per_page' => apply_filters('woocommerce_cross_sells_total', $posts_per_page), 'orderby' => $orderby, 'post__in' => $crosssells, 'meta_query' => $meta_query);
$products = new WP_Query($args);
$woocommerce_loop['columns'] = apply_filters('woocommerce_cross_sells_columns', $columns);
$items = sq_option('woo_cross_columns', 3);
if ($products->have_posts()) {
?>
<div class="cross-sells kleo-shop-<?php
echo $items;
?>
">
<div class="hr-title hr-full"><abbr><?php
_e('You may be interested in…', 'woocommerce');
?>
</abbr></div>
<?php
woocommerce_product_loop_start();
示例15: kleo_memberships
/**
* Get saved membership settings
* @return array
* @since 2.0
*/
function kleo_memberships($theme = '')
{
$restrict_options = sq_option('membership');
return $restrict_options;
}