本文整理汇总了PHP中wpex_option函数的典型用法代码示例。如果您正苦于以下问题:PHP wpex_option函数的具体用法?PHP wpex_option怎么用?PHP wpex_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了wpex_option函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: wpex_site_tracking_header
function wpex_site_tracking_header()
{
$tracking = wpex_option('tracking');
if ($tracking !== '') {
echo wpex_option('tracking');
}
}
示例2: wpex_search_overlay
function wpex_search_overlay()
{
// Do nothing if the main search is disabled
if (wpex_option('main_search', '1') !== '1') {
return;
}
// Only display on header style 1
if (wpex_option('header_style', 'one') !== 'one') {
return;
}
ob_start();
?>
<span class="search-overlay"></span>
<section id="site-searchform" class="header-one-searchform">
<div id="site-searchform-title"><?php
_e('Search', 'wpex');
?>
</div>
<div class="site-searchform-inner clr">
<form method="get" action="<?php
echo esc_url(home_url('/'));
?>
" role="search">
<input type="search" name="s" onfocus="if(this.value==this.defaultValue)this.value='';" onblur="if(this.value=='')this.value=this.defaultValue;" autocomplete="off" />
</form>
</div><!-- .site-searchform-inner -->
</section><!-- #site-searchform -->
<?php
echo ob_get_clean();
}
示例3: wpex_footer_callout
function wpex_footer_callout()
{
// Lets bail if the callout is disabled for this page/post --> see previous function
if (wpex_display_callout() == false) {
return;
}
// Get theme options
$callout_text = wpex_option('callout_text');
$callout_link = wpex_option('callout_link');
$callout_link_txt = wpex_option('callout_link_txt');
$callout_rel = wpex_option('callout_button_rel', 'dofollow');
$callout_target = wpex_option('callout_button_target', 'blank');
$rel = $callout_rel == 'nofollow' ? 'rel="nofollow"' : '';
ob_start();
?>
<div id="footer-callout-wrap" class="clr">
<div id="footer-callout" class="clr container">
<div id="footer-callout-left" class="clr <?php
if (wpex_option('callout_link') == '') {
echo 'full-width';
}
?>
">
<?php
// Echo the footer callout text
echo $callout_text;
?>
</div><!-- #footer-callout-left -->
<?php
// Display footer callout button if callout link & text options are not blank in the admin
if ($callout_link && $callout_link_txt) {
?>
<div id="footer-callout-right" class="">
<a href="<?php
echo $callout_link;
?>
" class="theme-button" title="<?php
echo $callout_link_txt;
?>
" target="_<?php
echo $callout_target;
?>
" <?php
echo $rel;
?>
><?php
echo $callout_link_txt;
?>
</a>
</div><!-- #footer-callout-right -->
<?php
}
?>
</div><!-- #footer-callout -->
</div><!-- #footer-callout-wrap -->
<?php
echo ob_get_clean();
}
示例4: wpex_get_sidebar
function wpex_get_sidebar($sidebar = 'sidebar')
{
// Pages
$custom_pages_sidebar = wpex_option('pages_custom_sidebar', '1');
if (is_singular('pages') && $custom_pages_sidebar == '1') {
return 'pages_sidebar';
}
// Staff
$custom_staff_sidebar = wpex_option('staff_custom_sidebar', '1');
if (is_singular('staff') && $custom_staff_sidebar == '1') {
return 'staff_sidebar';
}
// Portfolio
$custom_portfolio_sidebar = wpex_option('portfolio_custom_sidebar', '1');
if (is_singular('portfolio') && $custom_portfolio_sidebar == '1') {
return 'portfolio_sidebar';
}
// WooCommerce
if (class_exists('Woocommerce')) {
$woo_custom_sidebar = wpex_option('woo_custom_sidebar', '1');
if ($woo_custom_sidebar == '1' && is_woocommerce()) {
return 'woo_sidebar';
}
}
// Return the correct sidebar name & add useful hook
return apply_filters('wpex_get_sidebar', $sidebar);
}
示例5: wpex_post_entry_author_avatar_enabled
function wpex_post_entry_author_avatar_enabled()
{
// Theme settings
$author_avatar_toggle = wpex_option('blog_entry_author_avatar');
$blog_style = wpex_option('blog_style');
if ($author_avatar_toggle !== '1') {
return false;
}
if (!is_category() && $blog_style !== 'large-image-entry-style') {
return false;
}
// Category settings
if (is_category()) {
$term = get_query_var('cat');
$term_data = get_option("category_{$term}");
if (isset($term_data['wpex_term_style'])) {
if ($term_data['wpex_term_style'] !== '') {
$blog_style = $term_data['wpex_term_style'];
}
}
if ($blog_style !== 'large-image-entry-style') {
return false;
}
}
// End if category check
return true;
// If all else fails return true
}
示例6: wpex_blog_exclude_categories
function wpex_blog_exclude_categories()
{
// Wait..we don't want to be in these plages? Lets leave now!
if (is_admin()) {
return;
}
if (is_search()) {
return;
}
if (is_archive()) {
return;
}
// Categories to exclude
$cats_to_exclude = wpex_option('blog_cats_exclude');
// Admin option is blank, so bail.
if ($cats_to_exclude == '') {
return;
}
// Blog template
if (is_home() && !is_singular('page')) {
$exclude = $cats_to_exclude;
} else {
return;
// Do nothing, ok?
}
if ($cats_to_exclude) {
set_query_var('category__not_in', $cats_to_exclude);
}
}
示例7: wpex_post_meta
function wpex_post_meta()
{
global $post;
$post_id = $post->ID;
$category = get_the_category();
$fist_category = $category[0];
ob_start();
?>
<ul class="meta clr">
<li class="meta-date"><span class="fa fa-clock-o"></span><?php
echo get_the_date();
?>
</li>
<?php
if ($fist_category) {
?>
<li class="meta-category"><span class="fa fa-folder-o"></span><a href="<?php
echo get_category_link($category[0]->term_id);
?>
" title="<?php
echo $category[0]->cat_name;
?>
"><?php
echo $category[0]->cat_name;
?>
</a></li>
<?php
}
?>
<?php
if (comments_open()) {
?>
<li class="meta-comments comment-scroll"><span class="fa fa-comment-o"></span><?php
comments_popup_link(__('0 Comments', 'wpex'), __('1 Comment', 'wpex'), __('% Comments', 'wpex'), 'comments-link');
?>
</li>
<?php
}
?>
<?php
if (is_singular('post') && wpex_option('post_next_prev_meta', '1') == '1') {
?>
<li id="single-post-next-prev" class="clr">
<?php
next_post_link('%link', '<span class="theme-button"><span class="fa fa-chevron-left"></span></span>');
?>
<?php
previous_post_link('%link', '<span class="theme-button"><span class="fa fa-chevron-right"></span></span>');
?>
</li><!-- #single-post-next-prev -->
<?php
}
?>
</ul>
<?php
echo ob_get_clean();
}
示例8: wpex_custom_testimonials_args
function wpex_custom_testimonials_args($args)
{
//post name based on theme options
$post_type_name = wpex_option('testimonials_labels', __('Testimonials', 'wpex'));
$post_slug = wpex_option('testimonials_slug', 'testimonial-item');
$labels = array('name' => $post_type_name, 'singular_name' => $post_type_name . ' ' . __('Item', 'wpex'), 'add_new' => __('Add New Item', 'wpex'), 'add_new_item' => __('Add New', 'wpex') . ' ' . $post_type_name . ' ' . __('Item', 'wpex'), 'edit_item' => __('Edit New', 'wpex') . ' ' . $post_type_name . ' ' . __('Item', 'wpex'), 'new_item' => __('Add New', 'wpex') . ' ' . $post_type_name . ' ' . __('Item', 'wpex'), 'view_item' => __('View Item', 'wpex'), 'search_items' => __('Search', 'wpex') . $post_type_name, 'not_found' => __('No', 'wpex') . ' ' . $post_type_name . ' ' . __('items found', 'wpex'), 'not_found_in_trash' => __('No', 'wpex') . ' ' . $post_type_name . ' ' . __('items found in the trash', 'wpex'));
$custom_args = array('labels' => $labels, 'rewrite' => array("slug" => $post_slug));
return $custom_args + $args;
}
示例9: wpex_remove_wp_ver_css_js
function wpex_remove_wp_ver_css_js($src)
{
if (wpex_option('remove_scripts_version', '1') == '1') {
if (strpos($src, 'ver=')) {
$src = remove_query_arg('ver', $src);
}
}
return $src;
}
示例10: wpex_custom_testimonials_category_args
function wpex_custom_testimonials_category_args($args)
{
//post name based on theme options
$post_type_name = wpex_option('testimonials_labels', 'Testimonials') ? wpex_option('testimonials_labels', 'Testimonials') : 'Testimonials';
$tax_slug = wpex_option('testimonials_cat_slug', 'testimonials-category') ? wpex_option('testimonials_cat_slug', 'testimonials-category') : 'testimonials-category';
$taxonomy_testimonials_category_labels = array('name' => $post_type_name . ' ' . __('Categories', 'wpex'), 'singular_name' => $post_type_name . ' ' . __('Category', 'wpex'), 'search_items' => __('Search', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'popular_items' => __('Popular', 'wpex') . ' ' . $post_type_name . ' ' . __('Categories', 'wpex'), 'all_items' => __('All', 'wpex') . ' ' . $post_type_name . ' ' . __('Categories', 'wpex'), 'parent_item' => __('Parent', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'parent_item_colon' => __('Parent', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'edit_item' => __('Edit', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'update_item' => __('Update', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'add_new_item' => __('Add New', 'wpex') . ' ' . $post_type_name . ' ' . __('Category', 'wpex'), 'new_item_name' => __('New', 'wpex') . ' ' . $post_type_name . ' ' . __('Category name', 'wpex'), 'separate_items_with_commas' => __('Seperate', 'wpex') . ' ' . $post_type_name . ' ' . __('categories with commas', 'wpex'), 'add_or_remove_items' => __('Add or remove', 'wpex') . ' ' . $post_type_name . ' ' . __('categories', 'wpex'), 'choose_from_most_used' => __('Choose from the most used', 'wpex') . ' ' . $post_type_name . ' ' . __('categories', 'wpex'), 'menu_name' => $post_type_name . ' ' . __('Categories', 'wpex'));
$custom_taxonomy_testimonials_category_args = array('labels' => $taxonomy_testimonials_category_labels, 'rewrite' => array('slug' => $tax_slug));
return $custom_taxonomy_testimonials_category_args + $args;
}
示例11: wpex_get_post_layout_class
function wpex_get_post_layout_class()
{
// Vars
$class = 'right-sidebar';
$post_types = get_post_types('', 'names');
$blog_archives_layout = wpex_option('blog_archives_layout', 'right-sidebar');
// Loop through post types
foreach ($post_types as $post_type) {
if (is_singular($post_type)) {
if ($post_type == 'post') {
$post_type = 'blog';
}
global $post;
$post_id = $post->ID;
$admin_id = $post_type . '_single_layout';
$admin_setting = wpex_option($admin_id, 'right-sidebar');
$meta = get_post_meta($post_id, 'wpex_post_layout', true);
if ($meta !== '') {
$class = $meta;
} else {
$class = $admin_setting;
}
}
}
// Archives
if (is_archive() || is_author() || is_page_template('templates/blog.php')) {
$class = $blog_archives_layout;
}
// Cats
if (is_category()) {
$term = get_query_var('cat');
$term_data = get_option("category_{$term}");
if ($term_data) {
if ($term_data['wpex_term_layout'] !== '') {
$class = $term_data['wpex_term_layout'];
}
} else {
$class = $blog_archives_layout;
}
}
// Portfolio tax
if (is_tax('portfolio_category') || is_tax('portfolio_tag')) {
$class = wpex_option('portfolio_archive_layout', 'full-width');
}
// Staff tax
if (is_tax('staff_category') || is_tax('staff_tag')) {
$class = wpex_option('staff_archive_layout', 'full-width');
}
// Testimonials tax
if (is_tax('testimonials_category') || is_tax('testimonials_tag')) {
$class = wpex_option('testimonials_archive_layout', 'full-width');
}
// Return the correct class name
$class = apply_filters('wpex_post_layout_class', $class);
return $class;
}
示例12: wpex_footer_copyright
function wpex_footer_copyright()
{
$output;
$copyright = wpex_option('footer_copyright');
$copyright_content = wpex_option('footer_copyright_text');
if ($copyright !== '1') {
return;
}
$output = do_shortcode($copyright_content);
$output = apply_filters('wpex_copyright_info', $output);
echo $output;
}
示例13: wpex_get_header_style
function wpex_get_header_style($style = 'one')
{
$style = wpex_option('header_style', 'one');
if (is_singular()) {
global $post;
$post_id = $post->ID;
$meta = get_post_meta($post_id, 'wpex_header_style', true);
if ($meta) {
$style = $meta;
}
}
return $style;
}
示例14: wpex_layout_css
function wpex_layout_css()
{
$custom_css = '';
// Main Container With
$main_container_width = wpex_option('main_container_width');
if ($main_container_width !== '' && $main_container_width !== '980px') {
$custom_css .= '@media only screen and (min-width: 960px) {
.container, .wpb_row .wpb_row, .vc_row-fluid.container, .boxed-main-layout #wrap { width: ' . $main_container_width . '; }
.boxed-main-layout .is-sticky #site-header { width: ' . $main_container_width . '; }
}';
}
// Left container width
$left_container_width = wpex_option('left_container_width');
if ($left_container_width !== '' && $left_container_width !== '680px') {
$custom_css .= '@media only screen and (min-width: 960px) {
.content-area { width: ' . $left_container_width . '; }
}';
}
// Sidebar width
$sidebar_width = wpex_option('sidebar_width');
if ($sidebar_width !== '' && $sidebar_width !== '260px') {
$custom_css .= '@media only screen and (min-width: 960px) {#sidebar { width: ' . $sidebar_width . '; }}';
}
// Header Top Padding
$header_top_padding = wpex_option('header_top_padding');
if ($header_top_padding !== '' && $header_top_padding !== '30px') {
$custom_css .= '#site-header-inner { padding-top: ' . intval($header_top_padding) . 'px; }';
}
// Header Bottom Padding
$header_bottom_padding = wpex_option('header_bottom_padding');
if ($header_bottom_padding !== '' && $header_bottom_padding !== '30px') {
$custom_css .= '#site-header-inner { padding-bottom: ' . intval($header_bottom_padding) . 'px; }';
}
// Logo top margin
$logo_top_margin = wpex_option('logo_top_margin');
if ($logo_top_margin !== '' && $logo_top_margin !== '0px') {
$custom_css .= '#site-logo { margin-top: ' . intval($logo_top_margin) . 'px; }';
}
// Logo bottom margin
$logo_bottom_margin = wpex_option('logo_bottom_margin');
if ($logo_bottom_margin !== '' && $logo_bottom_margin !== '0px') {
$custom_css .= '#site-logo { margin-bottom: ' . intval($logo_bottom_margin) . 'px; }';
}
// trim white space for faster page loading
$custom_css_trimmed = preg_replace('/\\s+/', ' ', $custom_css);
// output css on front end
$css_output = "<!-- Custom CSS -->\n<style type=\"text/css\">\n" . $custom_css_trimmed . "\n</style>";
if (!empty($custom_css)) {
echo $css_output;
}
}
示例15: wpex_mobile_menu
function wpex_mobile_menu()
{
// If responsive is disabled, bail
if (wpex_option('responsive', '1') !== '1') {
return false;
}
// Vars
$mobile_menu_contact = wpex_option('mobile_menu_contact');
$mobile_menu_rss = wpex_option('mobile_menu_rss');
ob_start();
?>
<!-- Mobile navigation -->
<div id="sidr-close">
<a href="#sidr-close" class="toggle-sidr-close"></a>
</div>
<div id="mobile-menu" class="clr">
<a href="#sidr" class="mobile-menu-toggle"><span class="fa fa-bars"></span></a>
<?php
// Display items from the mobile menu
$menu_name = 'mobile_menu';
if (($locations = get_nav_menu_locations()) && isset($locations[$menu_name])) {
$menu = wp_get_nav_menu_object($locations[$menu_name]);
$menu_items = wp_get_nav_menu_items($menu->term_id);
foreach ((array) $menu_items as $key => $menu_item) {
$title = $menu_item->title;
$url = $menu_item->url;
$attr_title = $menu_item->attr_title;
?>
<a href="<?php
echo $url;
?>
" title="<?php
echo $attr_title;
?>
" class="mobile-menu-extra-icons mobile-menu-<?php
echo $title;
?>
"><span class="fa fa-<?php
echo $title;
?>
"></span></a>
<?php
}
}
?>
</div><!-- #mobile-menu -->
<?php
echo ob_get_clean();
}