本文整理汇总了PHP中bbp_is_search函数的典型用法代码示例。如果您正苦于以下问题:PHP bbp_is_search函数的具体用法?PHP bbp_is_search怎么用?PHP bbp_is_search使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了bbp_is_search函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: porto_page_title
function porto_page_title()
{
global $porto_settings;
$output = '';
if (!is_front_page()) {
} elseif (is_home()) {
$output .= $porto_settings['blog-title'];
}
if (is_singular()) {
$output .= porto_page_title_leaf();
} else {
if (is_post_type_archive()) {
if (is_search()) {
$output .= porto_page_title_leaf('search');
} else {
$output .= porto_page_title_archive();
}
} elseif (is_tax() || is_tag() || is_category()) {
$html = porto_page_title_leaf('term');
if (is_tag()) {
$output .= sprintf(__('Tag - %s', 'porto'), $html);
} elseif (is_tax('product_tag')) {
$output .= sprintf(__('Product Tag - %s', 'porto'), $html);
} else {
$output .= $html;
}
} elseif (is_date()) {
if (is_year()) {
$output .= porto_page_title_leaf('year');
} elseif (is_month()) {
$output .= porto_page_title_leaf('month');
} elseif (is_day()) {
$output .= porto_page_title_leaf('day');
}
} elseif (is_author()) {
$output .= porto_page_title_leaf('author');
} elseif (is_search()) {
$output .= porto_page_title_leaf('search');
} elseif (is_404()) {
$output .= porto_page_title_leaf('404');
} elseif (class_exists('bbPress') && is_bbpress()) {
if (bbp_is_search()) {
$output .= porto_page_title_leaf('bbpress_search');
} elseif (bbp_is_single_user()) {
$output .= porto_page_title_leaf('bbpress_user');
} else {
$output .= porto_page_title_leaf();
}
} else {
if (is_home() && !is_front_page()) {
if (get_option('show_on_front') == 'page') {
$output .= get_the_title(get_option('page_for_posts', true));
} else {
$output .= $porto_settings['blog-title'];
}
}
}
}
return apply_filters('porto_page_title', $output);
}
示例2: st_add_live_search
/**
* Add live search JavaScript to the footer
*/
function st_add_live_search()
{
if (of_get_option('st_live_search') == '0') {
if (class_exists('bbPress')) {
if (get_post_type() == 'forum' || get_post_type() == 'topic' || get_post_type() == 'reply' || bbp_is_search()) {
// If BBPRess
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#live-search #s').liveSearch({url: '<?php
bbp_search_url();
?>
/?ajax=on&bbp_search='});
});
</script>
<?php
}
} else {
// If KB
?>
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery('#live-search #s').liveSearch({url: '<?php
echo home_url();
?>
/?ajax=on&post_type=st_kb&s='});
});
</script>
<?php
}
}
}
示例3: sidebar_options
/**
* Get sidebar settings based on the page type
*
* @return array
*/
public function sidebar_options()
{
if (is_home()) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('blog_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('blog_archive_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position'));
} elseif (function_exists('is_bbpress') && is_bbpress()) {
$sidebars = array('global' => Avada()->settings->get('bbpress_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position'));
if (bbp_is_forum_archive() || bbp_is_topic_archive() || bbp_is_user_home() || bbp_is_search()) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position'));
}
} elseif (function_exists('is_buddypress') && is_buddypress()) {
$sidebars = array('global' => Avada()->settings->get('bbpress_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ppbress_sidebar'), 'sidebar_2' => Avada()->settings->get('ppbress_sidebar_2'), 'position' => Avada()->settings->get('bbpress_sidebar_position'));
} elseif (class_exists('WooCommerce') && (is_product() || is_shop())) {
$sidebars = array('global' => Avada()->settings->get('woo_global_sidebar'), 'sidebar_1' => Avada()->settings->get('woo_sidebar'), 'sidebar_2' => Avada()->settings->get('woo_sidebar_2'), 'position' => Avada()->settings->get('woo_sidebar_position'));
} elseif (class_exists('WooCommerce') && (is_product_category() || is_product_tag())) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('woocommerce_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('woocommerce_archive_sidebar_2'), 'position' => Avada()->settings->get('woo_sidebar_position'));
} elseif (is_page()) {
$sidebars = array('global' => Avada()->settings->get('pages_global_sidebar'), 'sidebar_1' => Avada()->settings->get('pages_sidebar'), 'sidebar_2' => Avada()->settings->get('pages_sidebar_2'), 'position' => Avada()->settings->get('default_sidebar_pos'));
} elseif (is_single()) {
$sidebars = array('global' => Avada()->settings->get('posts_global_sidebar'), 'sidebar_1' => Avada()->settings->get('posts_sidebar'), 'sidebar_2' => Avada()->settings->get('posts_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position'));
if (is_singular('avada_portfolio')) {
$sidebars = array('global' => Avada()->settings->get('portfolio_global_sidebar'), 'sidebar_1' => Avada()->settings->get('portfolio_sidebar'), 'sidebar_2' => Avada()->settings->get('portfolio_sidebar_2'), 'position' => Avada()->settings->get('portfolio_sidebar_position'));
} else {
if (is_singular('tribe_events') || is_singular('tribe_organizer') || is_singular('tribe_venue')) {
$sidebars = array('global' => Avada()->settings->get('ec_global_sidebar'), 'sidebar_1' => Avada()->settings->get('ec_sidebar'), 'sidebar_2' => Avada()->settings->get('ec_sidebar_2'), 'position' => Avada()->settings->get('ec_sidebar_pos'));
}
}
if (is_singular('tribe_organizer') || is_singular('tribe_venue')) {
$sidebars['global'] = 1;
}
} elseif (is_archive()) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('blog_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('blog_archive_sidebar_2'), 'position' => Avada()->settings->get('blog_sidebar_position'));
if (is_post_type_archive('avada_portfolio') || is_tax('portfolio_category') || is_tax('portfolio_skills') || is_tax('portfolio_tags')) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('portfolio_archive_sidebar'), 'sidebar_2' => Avada()->settings->get('portfolio_archive_sidebar_2'), 'position' => Avada()->settings->get('portfolio_sidebar_position'));
}
} elseif (is_search()) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('search_sidebar'), 'sidebar_2' => Avada()->settings->get('search_sidebar_2'), 'position' => Avada()->settings->get('search_sidebar_position'));
} else {
$sidebars = array('global' => Avada()->settings->get('pages_global_sidebar'), 'sidebar_1' => Avada()->settings->get('pages_sidebar'), 'sidebar_2' => Avada()->settings->get('pages_sidebar_2'), 'position' => Avada()->settings->get('default_sidebar_pos'));
}
if (class_exists('Tribe__Events__Main') && is_events_archive()) {
$sidebars = array('global' => '1', 'sidebar_1' => Avada()->settings->get('ec_sidebar'), 'sidebar_2' => Avada()->settings->get('ec_sidebar_2'), 'position' => Avada()->settings->get('ec_sidebar_pos'));
}
// Remove sidebars from the certain woocommerce pages
if (class_exists('WooCommerce')) {
if (is_cart() || is_checkout() || is_account_page() || get_option('woocommerce_thanks_page_id') && is_page(get_option('woocommerce_thanks_page_id'))) {
$sidebars = array();
}
}
return $sidebars;
}
示例4: load_modules
public function load_modules()
{
if (!function_exists('bbp_version')) {
return;
}
if (function_exists('bbp_is_search')) {
$this->is_search = bbp_is_search();
}
if (is_admin()) {
if ($this->o['admin_disable_active'] == 1 && !d4p_bbp_is_role('admin_disable')) {
require_once GDBBPRESSTOOLS_PATH . 'code/mods/access.php';
$this->mod['a'] = new gdbbMod_Access();
}
} else {
if ($this->o['quote_active'] == 1 && d4p_bbp_is_role('quote') && !$this->is_search) {
require_once GDBBPRESSTOOLS_PATH . 'code/mods/quote.php';
$this->mod['q'] = new gdbbMod_Quote($this->o['quote_location'], $this->o['quote_method']);
}
}
if ($this->o['signature_active'] == 1) {
require_once GDBBPRESSTOOLS_PATH . 'code/mods/signature.php';
$this->mod['i'] = new gdbbMod_Signature($this->o['signature_length'], d4p_bbp_is_role('signature_enhanced'), $this->o['signature_method'], $this->o['signature_buddypress_profile_group']);
$this->mod['i']->active = d4p_bbp_is_role('signature');
}
if ($this->o['bbcodes_active'] == 1) {
require_once GDBBPRESSTOOLS_PATH . 'code/mods/bbcodes.php';
$this->mod['s'] = new gdbbMod_Shortcodes($this->o['bbcodes_bbpress_only'] == 1, !d4p_bbp_is_role('bbcodes_special'), 'info', $this->o['bbcodes_deactivated'], $this->o['bbcodes_notice'] == 1);
}
if (GDBBPRESSTOOLS_WPV > 32 && $this->o['toolbar_active'] == 1 && d4p_bbp_is_role('toolbar')) {
require_once GDBBPRESSTOOLS_PATH . 'code/mods/toolbar.php';
$this->mod['t'] = new gdbbMod_Toolbar();
}
$views = array();
$active = false;
foreach ($this->o as $key => $val) {
if (substr($key, 0, 5) == 'view_') {
$parts = explode('_', $key, 3);
$views[$parts[1]][$parts[2]] = $val;
if (!$active && $parts[2] == 'active' && $val == 1) {
$active = true;
}
}
}
if ($active) {
require_once GDBBPRESSTOOLS_PATH . 'code/mods/views.php';
$this->mod['s'] = new gdbbMod_Views($views);
}
}
示例5: bbp_template_include_theme_supports
/**
* Possibly intercept the template being loaded
*
* Listens to the 'template_include' filter and waits for any bbPress specific
* template condition to be met. If one is met and the template file exists,
* it will be used; otherwise
*
* Note that the _edit() checks are ahead of their counterparts, to prevent them
* from being stomped on accident.
*
* @since bbPress (r3032)
*
* @param string $template
*
* @uses bbp_is_single_user() To check if page is single user
* @uses bbp_get_single_user_template() To get user template
* @uses bbp_is_single_user_edit() To check if page is single user edit
* @uses bbp_get_single_user_edit_template() To get user edit template
* @uses bbp_is_single_view() To check if page is single view
* @uses bbp_get_single_view_template() To get view template
* @uses bbp_is_search() To check if page is search
* @uses bbp_get_search_template() To get search template
* @uses bbp_is_forum_edit() To check if page is forum edit
* @uses bbp_get_forum_edit_template() To get forum edit template
* @uses bbp_is_topic_merge() To check if page is topic merge
* @uses bbp_get_topic_merge_template() To get topic merge template
* @uses bbp_is_topic_split() To check if page is topic split
* @uses bbp_get_topic_split_template() To get topic split template
* @uses bbp_is_topic_edit() To check if page is topic edit
* @uses bbp_get_topic_edit_template() To get topic edit template
* @uses bbp_is_reply_move() To check if page is reply move
* @uses bbp_get_reply_move_template() To get reply move template
* @uses bbp_is_reply_edit() To check if page is reply edit
* @uses bbp_get_reply_edit_template() To get reply edit template
* @uses bbp_set_theme_compat_template() To set the global theme compat template
*
* @return string The path to the template file that is being used
*/
function bbp_template_include_theme_supports($template = '')
{
// Editing a user
if (bbp_is_single_user_edit() && ($new_template = bbp_get_single_user_edit_template())) {
// User favorites
} elseif (bbp_is_favorites() && ($new_template = bbp_get_favorites_template())) {
// User favorites
} elseif (bbp_is_subscriptions() && ($new_template = bbp_get_subscriptions_template())) {
// Viewing a user
} elseif (bbp_is_single_user() && ($new_template = bbp_get_single_user_template())) {
// Single View
} elseif (bbp_is_single_view() && ($new_template = bbp_get_single_view_template())) {
// Search
} elseif (bbp_is_search() && ($new_template = bbp_get_search_template())) {
// Forum edit
} elseif (bbp_is_forum_edit() && ($new_template = bbp_get_forum_edit_template())) {
// Single Forum
} elseif (bbp_is_single_forum() && ($new_template = bbp_get_single_forum_template())) {
// Forum Archive
} elseif (bbp_is_forum_archive() && ($new_template = bbp_get_forum_archive_template())) {
// Topic merge
} elseif (bbp_is_topic_merge() && ($new_template = bbp_get_topic_merge_template())) {
// Topic split
} elseif (bbp_is_topic_split() && ($new_template = bbp_get_topic_split_template())) {
// Topic edit
} elseif (bbp_is_topic_edit() && ($new_template = bbp_get_topic_edit_template())) {
// Single Topic
} elseif (bbp_is_single_topic() && ($new_template = bbp_get_single_topic_template())) {
// Topic Archive
} elseif (bbp_is_topic_archive() && ($new_template = bbp_get_topic_archive_template())) {
// Reply move
} elseif (bbp_is_reply_move() && ($new_template = bbp_get_reply_move_template())) {
// Editing a reply
} elseif (bbp_is_reply_edit() && ($new_template = bbp_get_reply_edit_template())) {
// Single Reply
} elseif (bbp_is_single_reply() && ($new_template = bbp_get_single_reply_template())) {
// Editing a topic tag
} elseif (bbp_is_topic_tag_edit() && ($new_template = bbp_get_topic_tag_edit_template())) {
// Viewing a topic tag
} elseif (bbp_is_topic_tag() && ($new_template = bbp_get_topic_tag_template())) {
}
// A bbPress template file was located, so override the WordPress template
// and use it to switch off bbPress's theme compatibility.
if (!empty($new_template)) {
$template = bbp_set_template_included($new_template);
}
return apply_filters('bbp_template_include_theme_supports', $template);
}
示例6: x_bbpress_filter_breadcrumbs
function x_bbpress_filter_breadcrumbs($r)
{
if (bbp_is_search()) {
$current_text = bbp_get_search_title();
} elseif (bbp_is_forum_archive()) {
$current_text = bbp_get_forum_archive_title();
} elseif (bbp_is_topic_archive()) {
$current_text = bbp_get_topic_archive_title();
} elseif (bbp_is_single_view()) {
$current_text = bbp_get_view_title();
} elseif (bbp_is_single_forum()) {
$current_text = bbp_get_forum_title();
} elseif (bbp_is_single_topic()) {
$current_text = bbp_get_topic_title();
} elseif (bbp_is_single_reply()) {
$current_text = bbp_get_reply_title();
} elseif (bbp_is_topic_tag() || get_query_var('bbp_topic_tag') && !bbp_is_topic_tag_edit()) {
// Always include the tag name
$tag_data[] = bbp_get_topic_tag_name();
// If capable, include a link to edit the tag
if (current_user_can('manage_topic_tags')) {
$tag_data[] = '<a href="' . esc_url(bbp_get_topic_tag_edit_link()) . '" class="bbp-edit-topic-tag-link">' . esc_html__('(Edit)', 'bbpress') . '</a>';
}
// Implode the results of the tag data
$current_text = sprintf(__('Topic Tag: %s', 'bbpress'), implode(' ', $tag_data));
} elseif (bbp_is_topic_tag_edit()) {
$current_text = __('Edit', 'bbpress');
} else {
$current_text = get_the_title();
}
$r = array('before' => '', 'after' => '', 'sep' => x_get_breadcrumb_delimiter(), 'pad_sep' => 0, 'sep_before' => '', 'sep_after' => '', 'crumb_before' => '', 'crumb_after' => '', 'include_home' => false, 'home_text' => x_get_breadcrumb_home_text(), 'include_root' => true, 'root_text' => bbp_get_forum_archive_title(), 'include_current' => true, 'current_text' => $current_text, 'current_before' => x_get_breadcrumb_current_before(), 'current_after' => x_get_breadcrumb_current_after());
return $r;
}
示例7: the_post
the_post();
if (has_excerpt()) {
the_excerpt();
}
}
}
} elseif (class_exists('WooCommerce') and is_shop() || is_singular('product') || is_tax('product_cat') || is_tax('product_tag')) {
if (hippo_option('shop-short-description')) {
?>
<p><?php
echo wp_kses(hippo_option('shop-short-description'), array('a' => array('href' => array(), 'title' => array(), 'class' => array()), 'br' => array(), 'em' => array(), 'strong' => array(), 'ul' => array('class' => array()), 'li' => array('class' => array()), 'p' => array('class' => array()), 'span' => array('class' => array())));
?>
</p>
<?php
}
} elseif (function_exists('is_bbpress') and is_bbpress() || bbp_is_forum_archive() || bbp_is_topic_archive() || bbp_is_topic_tag() || bbp_is_single_forum() || bbp_is_single_topic() || bbp_is_single_user() || bbp_is_search()) {
if (hippo_option('forum-short-description')) {
?>
<p><?php
echo wp_kses(hippo_option('forum-short-description'), array('a' => array('href' => array(), 'title' => array(), 'class' => array()), 'br' => array(), 'em' => array(), 'strong' => array(), 'ul' => array('class' => array()), 'li' => array('class' => array()), 'p' => array('class' => array()), 'span' => array('class' => array())));
?>
</p>
<?php
}
} else {
if (hippo_option('blog-short-description')) {
?>
<p><?php
echo wp_kses(hippo_option('blog-short-description'), array('a' => array('href' => array(), 'title' => array(), 'class' => array()), 'br' => array(), 'em' => array(), 'strong' => array(), 'ul' => array('class' => array()), 'li' => array('class' => array()), 'p' => array('class' => array()), 'span' => array('class' => array())));
?>
示例8: get_page_header_title
protected function get_page_header_title()
{
global $oxy_theme_options;
if (bbp_is_forum_archive()) {
return $oxy_theme_options['bbpress_header_forums'];
} else {
if (bbp_is_topic_archive()) {
return $oxy_theme_options['bbpress_header_topics'];
} else {
if (bbp_is_single_view()) {
return bbp_get_view_title();
} else {
if (bbp_is_single_forum()) {
return bbp_get_forum_title();
} else {
if (bbp_is_single_topic()) {
return bbp_get_topic_title();
} else {
if (bbp_is_topic_tag()) {
return __('Tag: ', 'omega-td') . bbp_get_topic_tag_name();
} else {
if (bbp_is_single_reply()) {
return bbp_get_reply_title();
} else {
if (bbp_is_topic_tag_edit()) {
return __('Edit', 'omega-td');
} else {
if (bbp_is_search()) {
return bbp_get_search_title();
} else {
if (bbp_is_single_user()) {
return bbp_get_displayed_user_field('display_name');
} else {
return get_the_title();
}
}
}
}
}
}
}
}
}
}
}
示例9: get_post_meta
}
if ($sidebar_1 != 'None' && $sidebar_2 != 'None') {
$body_classes[] = 'double-sidebars';
}
} else {
$sidebar_1 = get_post_meta($c_pageID, 'sbg_selected_sidebar_replacement', true);
$sidebar_2 = get_post_meta($c_pageID, 'sbg_selected_sidebar_2_replacement', true);
if (is_array($sidebar_1) && $sidebar_1[0]) {
$body_classes[] = 'has-sidebar';
}
if (is_array($sidebar_1) && $sidebar_1[0] && is_array($sidebar_2) && $sidebar_2[0]) {
$body_classes[] = 'double-sidebars';
}
}
}
if (is_bbpress() && (bbp_is_forum_archive() || bbp_is_topic_archive() || bbp_is_user_home() || bbp_is_search())) {
$sidebar_1 = $smof_data['ppbress_sidebar'];
$sidebar_2 = $smof_data['ppbress_sidebar_2'];
if ($sidebar_1 != 'None') {
$body_classes[] = 'has-sidebar';
}
if ($sidebar_1 != 'None' && $sidebar_2 != 'None') {
$body_classes[] = 'double-sidebars';
}
}
if (class_exists('TribeEvents') && is_events_archive()) {
if ($smof_data['pages_sidebar'] != 'None') {
$sidebar_1 = array($smof_data['pages_sidebar']);
} else {
$sidebar_1 = '';
}
示例10: prepare_breadcrumb_html
/**
* Prepare the full output of the breadcrumb path
*
* @return void
*/
private function prepare_breadcrumb_html()
{
// Add the path prefix
$this->html_markup = $this->get_breadcrumb_prefix();
// Add the "Home" link
$this->html_markup .= $this->get_breadcrumb_home();
// Woocommerce path prefix (e.g "Shop" )
if (class_exists('Woocommerce') && (is_woocommerce() && is_archive() && !is_shop() || is_cart() || is_checkout() || is_account_page())) {
$this->html_markup .= $this->get_woocommerce_shop_page();
}
// bbPress path prefix (e.g "Forums" )
if (class_exists('bbPress') && is_bbpress() && (bbp_is_topic_archive() || bbp_is_single_user() || bbp_is_search())) {
$this->html_markup .= $this->get_bbpress_main_archive_page();
}
// Single Posts and Pages (of all post types)
if (is_singular()) {
// If the post type of the current post has an archive link, display the archive breadcrumb
if (isset($this->post->post_type) && get_post_type_archive_link($this->post->post_type) && $this->show_post_type_archive) {
$this->html_markup .= $this->get_post_type_archive();
}
// If the post doesn't have parents
if (isset($this->post->post_parent) && $this->post->post_parent == 0) {
$this->html_markup .= $this->get_post_terms();
// If there are parents; mostly for pages
} else {
$this->html_markup .= $this->get_post_ancestors();
}
$this->html_markup .= $this->get_breadcrumb_leaf_markup();
} else {
// Custom post types archives
if (is_post_type_archive()) {
$this->html_markup .= $this->get_post_type_archive(FALSE);
// Search on custom post type (e.g. Woocommerce)
if (is_search()) {
$this->html_markup .= $this->get_breadcrumb_leaf_markup('search');
}
// Taxonomy Archives
} elseif (is_tax() || is_tag() || is_category()) {
// If we have a tag archive, add the tag prefix
if (is_tag()) {
$this->html_markup .= $this->tag_archive_prefix;
}
$this->html_markup .= $this->get_taxonomies();
$this->html_markup .= $this->get_breadcrumb_leaf_markup('term');
// Date Archives
} elseif (is_date()) {
global $wp_locale;
// Set variables
$year = esc_html(get_query_var('year'));
if (is_month() || is_day()) {
$month = get_query_var('monthnum');
$month_name = $wp_locale->get_month($month);
}
// Year Archive, only is a leaf
if (is_year()) {
$this->html_markup .= $this->get_breadcrumb_leaf_markup('year');
// Month Archive, needs year link and month leaf
} elseif (is_month()) {
$this->html_markup .= $this->get_single_breadcrumb_markup($year, get_year_link($year));
$this->html_markup .= $this->get_breadcrumb_leaf_markup('month');
// Day Archive, needs year and month link and day leaf
} elseif (is_day()) {
$this->html_markup .= $this->get_single_breadcrumb_markup($year, get_year_link($year));
$this->html_markup .= $this->get_single_breadcrumb_markup($month_name, get_month_link($year, $month));
$this->html_markup .= $this->get_breadcrumb_leaf_markup('day');
}
// Author Archives
} elseif (is_author()) {
$this->html_markup .= $this->get_breadcrumb_leaf_markup('author');
// Search Page
} elseif (is_search()) {
$this->html_markup .= $this->get_breadcrumb_leaf_markup('search');
// 404 Page
} elseif (is_404()) {
// Special treatment for Events Calendar to avoid 404 messages on list view
if (class_exists('TribeEvents') && tribe_is_event() || is_events_archive()) {
$this->html_markup .= $this->get_breadcrumb_leaf_markup('events');
// Default case
} else {
$this->html_markup .= $this->get_breadcrumb_leaf_markup('404');
}
// bbPress
} elseif (class_exists('bbPress')) {
// Search Page
if (bbp_is_search()) {
$this->html_markup .= $this->get_breadcrumb_leaf_markup('bbpress_search');
// User page
} elseif (bbp_is_single_user()) {
$this->html_markup .= $this->get_breadcrumb_leaf_markup('bbpress_user');
}
}
}
}
示例11: of_get_option
<!-- #page-header -->
<div id="page-header">
<div class="container">
<h1><?php
if (bbp_is_search()) {
_e("Search: ", "framework");
}
echo of_get_option('st_forum_title');
?>
</h1>
<!-- #live-search -->
<div id="live-search">
<form role="search" method="get" id="searchform" class="clearfix" action="<?php
bbp_search_url();
?>
" autocomplete="off">
<input type="text" onfocus="if (this.value == '<?php
_e("Search the forum...", "framework");
?>
') {this.value = '';}" onblur="if (this.value == '') {this.value = '<?php
_e("Search the forum...", "framework");
?>
';}" value="<?php
_e("Search the forum...", "framework");
?>
" name="bbp_search" id="s" />
</form>
示例12: wm_bbp_content_type
function wm_bbp_content_type($content_type)
{
//Preparing output
if (bbp_is_search() || bbp_is_topic_tag() || bbp_is_single_view()) {
$content_type = 'bbpress-archive';
} elseif (bbp_is_single_reply() || bbp_is_topic_edit() || bbp_is_topic_merge() || bbp_is_topic_split() || bbp_is_reply_edit() || bbp_is_reply_move() || bbp_is_topic_tag_edit() || bbp_is_single_user() || bbp_is_single_user_edit()) {
$content_type = 'bbpress-article';
}
//Output
return apply_filters('wmhook_wm_bbp_content_type_output', $content_type);
}
示例13: porto_breadcrumbs
function porto_breadcrumbs()
{
// use yoast breadcrumbs if enabled
if (function_exists('yoast_breadcrumb')) {
$yoast_breadcrumbs = yoast_breadcrumb('', '', false);
if ($yoast_breadcrumbs) {
return $yoast_breadcrumbs;
}
}
global $porto_settings;
$post = isset($GLOBALS['post']) ? $GLOBALS['post'] : null;
$output = '';
// add breadcrumbs prefix
if (!is_front_page()) {
if (isset($porto_settings['breadcrumbs-prefix']) && $porto_settings['breadcrumbs-prefix']) {
$output .= '<span class="breadcrumbs-prefix">' . $porto_settings['breadcrumbs-prefix'] . '</span>';
}
}
// breadcrumbs start wrap
$output .= '<ul class="breadcrumb">';
// add home link
if (!is_front_page()) {
$output .= porto_breadcrumbs_link(__('Home', 'porto'), apply_filters('woocommerce_breadcrumb_home_url', home_url()));
} elseif (is_home()) {
$output .= porto_breadcrumbs_link($porto_settings['blog-title']);
}
// add woocommerce shop page link
if (class_exists('WooCommerce') && (is_woocommerce() && is_archive() && !is_shop() || is_cart() || is_checkout() || is_account_page())) {
$output .= porto_breadcrumbs_shop_link();
}
// add bbpress forums link
if (class_exists('bbPress') && is_bbpress() && (bbp_is_topic_archive() || bbp_is_single_user() || bbp_is_search() || bbp_is_topic_tag() || bbp_is_edit())) {
$output .= porto_breadcrumbs_link(bbp_get_forum_archive_title(), get_post_type_archive_link('forum'));
}
if (is_singular()) {
if (isset($post->post_type) && get_post_type_archive_link($post->post_type) && (isset($porto_settings['breadcrumbs-archives-link']) && $porto_settings['breadcrumbs-archives-link'])) {
$output .= porto_breadcrumbs_archive_link();
} elseif (isset($post->post_type) && $post->post_type == 'post' && get_option('show_on_front') == 'page' && (isset($porto_settings['breadcrumbs-blog-link']) && $porto_settings['breadcrumbs-blog-link'])) {
$output .= porto_breadcrumbs_link(get_the_title(get_option('page_for_posts', true)), get_permalink(get_option('page_for_posts')));
}
if (isset($post->post_parent) && $post->post_parent == 0) {
$output .= porto_breadcrumbs_terms_link();
} else {
$output .= porto_breadcrumbs_ancestors_link();
}
$output .= porto_breadcrumb_leaf();
} else {
if (is_post_type_archive()) {
if (is_search()) {
$output .= porto_breadcrumbs_archive_link();
$output .= porto_breadcrumb_leaf('search');
} else {
$output .= porto_breadcrumbs_archive_link(false);
}
} elseif (is_tax() || is_tag() || is_category()) {
$html = porto_breadcrumbs_taxonomies_link();
$html .= porto_breadcrumb_leaf('term');
if (is_tag()) {
if (get_option('show_on_front') == 'page' && (isset($porto_settings['breadcrumbs-blog-link']) && $porto_settings['breadcrumbs-blog-link'])) {
$output .= porto_breadcrumbs_link(get_the_title(get_option('page_for_posts', true)), get_permalink(get_option('page_for_posts')));
}
$output .= sprintf(__('Tag - %s', 'porto'), $html);
} elseif (is_tax('product_tag')) {
$output .= sprintf(__('Product Tag - %s', 'porto'), $html);
} else {
if (is_category() && get_option('show_on_front') == 'page' && (isset($porto_settings['breadcrumbs-blog-link']) && $porto_settings['breadcrumbs-blog-link'])) {
$output .= porto_breadcrumbs_link(get_the_title(get_option('page_for_posts', true)), get_permalink(get_option('page_for_posts')));
}
if (is_tax('portfolio_cat') || is_tax('portfolio_skills')) {
$output .= porto_breadcrumbs_link(porto_breadcrumbs_archive_name('portfolio'), get_post_type_archive_link('portfolio'));
}
if (is_tax('member_cat')) {
$output .= porto_breadcrumbs_link(porto_breadcrumbs_archive_name('member'), get_post_type_archive_link('member'));
}
if (is_tax('faq_cat')) {
$output .= porto_breadcrumbs_link(porto_breadcrumbs_archive_name('faq'), get_post_type_archive_link('faq'));
}
$output .= $html;
}
} elseif (is_date()) {
global $wp_locale;
if (get_option('show_on_front') == 'page' && (isset($porto_settings['breadcrumbs-blog-link']) && $porto_settings['breadcrumbs-blog-link'])) {
$output .= porto_breadcrumbs_link(get_the_title(get_option('page_for_posts', true)), get_permalink(get_option('page_for_posts')));
}
$year = esc_html(get_query_var('year'));
if (is_month() || is_day()) {
$month = get_query_var('monthnum');
$month_name = $wp_locale->get_month($month);
}
if (is_year()) {
$output .= porto_breadcrumb_leaf('year');
} elseif (is_month()) {
$output .= porto_breadcrumbs_link($year, get_year_link($year));
$output .= porto_breadcrumb_leaf('month');
} elseif (is_day()) {
$output .= porto_breadcrumbs_link($year, get_year_link($year));
$output .= porto_breadcrumbs_link($month_name, get_month_link($year, $month));
$output .= porto_breadcrumb_leaf('day');
}
} elseif (is_author()) {
//.........这里部分代码省略.........
示例14: restrict_widget
//.........这里部分代码省略.........
} elseif (isset($instance['rw_opt']['devices_desktop'])) {
$found_device = false;
}
} else {
if (isset($instance['rw_opt']['devices_desktop'], $instance['rw_opt']['devices_mobile']) || isset($instance['rw_opt']['devices_desktop'])) {
$found_device = true;
} elseif (isset($instance['rw_opt']['devices_mobile'])) {
$found_device = false;
}
}
if ($display_type === true) {
if ($found_device === true) {
$display_device = true;
} else {
$return = true;
$display_device = false;
}
} else {
$display_device = $found_device === true ? false : true;
}
} else {
$display_device = true;
}
}
//others
if ($return === false) {
if (isset($instance['rw_opt']) && $this->is_widget_empty($instance['rw_opt'], 'main') === false) {
$empty_main = false;
if (is_front_page()) {
$found_main = isset($instance['rw_opt']['others_front_page']) ? true : false;
if (is_home() && $found_main == false) {
$found_main = isset($instance['rw_opt']['others_blog_page']) ? true : false;
}
} elseif (is_home()) {
$found_main = isset($instance['rw_opt']['others_blog_page']) ? true : false;
} elseif (is_singular()) {
if (is_page()) {
if (isset($instance['rw_opt']['cpt_' . get_post_type($post_id)])) {
$found_main = true;
} else {
$found_main = isset($instance['rw_opt']['pageid_' . $post_id]) ? true : false;
}
} else {
$found_main = isset($instance['rw_opt']['cpt_' . get_post_type($post_id)]) ? true : false;
if (is_single() && $found_main == false) {
$found_main = isset($instance['rw_opt']['others_single_post']) ? true : false;
}
}
} elseif (is_post_type_archive()) {
$found_main = isset($instance['rw_opt']['cpta_' . get_query_var('post_type')]) ? true : false;
} elseif (is_category()) {
$found_main = isset($instance['rw_opt']['category_' . get_query_var('cat')]) ? true : false;
} elseif (is_tag()) {
if (($object = get_queried_object()) !== NULL && isset($object->taxonomy) && $object->taxonomy === 'post_tag') {
$tag = 'wp_log_type';
} else {
$tag = '';
}
$found_main = isset($instance['rw_opt']['taxonomy_' . $tag]) ? true : false;
} elseif (is_tax()) {
$found_main = isset($instance['rw_opt']['taxonomy_' . get_query_var('taxonomy')]) ? true : false;
} elseif (is_404()) {
$found_main = isset($instance['rw_opt']['others_404_page']) ? true : false;
} elseif (is_sticky()) {
$found_main = isset($instance['rw_opt']['others_sticky_post']) ? true : false;
} elseif (is_search()) {
$found_main = isset($instance['rw_opt']['others_search_page']) ? true : false;
} elseif (is_author()) {
$found_main = isset($instance['rw_opt']['others_author_archive']) ? true : false;
} elseif (is_date()) {
$found_main = isset($instance['rw_opt']['others_date_archive']) ? true : false;
} elseif (function_exists('bbp_is_search') && bbp_is_search()) {
$found_main = isset($instance['rw_opt']['bbpress_search']) ? true : false;
} elseif (function_exists('bbp_is_single_user') && bbp_is_single_user()) {
$found_main = isset($instance['rw_opt']['bbpress_single_user']) ? true : false;
} elseif (function_exists('bbp_is_topic_tag') && bbp_is_topic_tag()) {
$found_main = isset($instance['rw_opt']['bbpress_topic_tag']) ? true : false;
}
$display_main = $display_type === true ? $found_main === true ? true : false : ($found_main === true ? false : true);
} else {
$display_main = true;
}
}
if ($filter === false) {
$instance = true;
}
if ($display_type === true) {
$final_return = $display_lang === true && $display_user === true && $display_device === true && $display_main === true ? $instance : false;
} else {
$final_return = $empty_lang === false && $empty_user === false && $empty_device === false && $empty_main === false && $display_lang === false && $display_user === false && $display_device === false && $display_main === false || $empty_lang === false && $empty_user === false && $empty_device === false && $display_lang === false && $display_user === false && $display_device === false || $empty_lang === false && $empty_user === false && $empty_main === false && $display_lang === false && $display_user === false && $display_main === false || $empty_lang === false && $empty_device === false && $empty_main === false && $display_lang === false && $display_device === false && $display_main === false || $empty_user === false && $empty_device === false && $empty_main === false && $display_user === false && $display_device === false && $display_main === false || $empty_lang === false && $empty_user === false && $display_lang === false && $display_user === false || $empty_lang === false && $empty_device === false && $display_lang === false && $display_device === false || $empty_lang === false && $empty_main === false && $display_lang === false && $display_main === false || $empty_user === false && $empty_device === false && $display_user === false && $display_device === false || $empty_user === false && $empty_main === false && $display_user === false && $display_main === false || $empty_device === false && $empty_main === false && $display_device === false && $display_main === false || $empty_lang === false && $display_lang === false || $empty_user === false && $display_user === false || $empty_device === false && $display_device === false || $empty_main === false && $display_main === false ? false : $instance;
}
//filter true or false
if ($filter === true) {
$final_return = apply_filters_ref_array('rw_display_widget', array($final_return, $instance));
}
//if true return instance
$final_return = $final_return === false ? false : $instance;
//display: return $instance, hide: return false
return $final_return;
}
示例15: hippo_title_text
function hippo_title_text()
{
$query = get_queried_object();
if (is_archive()) {
if (is_day()) {
$archive_title = get_the_time('d F, Y');
$title = sprintf(esc_html__('Archive of: %s', 'monsoon'), $archive_title);
} elseif (is_month()) {
$archive_title = get_the_time('F Y');
$title = sprintf(esc_html__('Archive of: %s', 'monsoon'), $archive_title);
} elseif (is_year()) {
$archive_title = get_the_time('Y');
$title = sprintf(esc_html__('Archive of: %s', 'monsoon'), $archive_title);
}
}
if (is_404()) {
$title = esc_html__('404 Not Found', 'monsoon');
}
if (is_search()) {
$title = sprintf(esc_html__('Search result for: "%s"', 'monsoon'), get_search_query());
}
if (function_exists('bbp_is_search') and bbp_is_search()) {
$title = sprintf(esc_html__('Search result for: "%s"', 'monsoon'), get_search_query());
}
if (is_category()) {
$title = sprintf(esc_html__('Category: %s', 'monsoon'), $query->name);
}
if (is_tag()) {
$title = sprintf(esc_html__('Tag: %s', 'monsoon'), $query->name);
}
if (function_exists('bbp_is_topic_tag') and bbp_is_topic_tag()) {
$title = sprintf(esc_html__('Tag: %s', 'monsoon'), $query->name);
}
if (is_author()) {
$title = sprintf(esc_html__('Posts of: %s', 'monsoon'), $query->display_name);
}
if (is_page()) {
$title = esc_html($query->post_title);
}
if (is_home() or is_single()) {
$title = esc_html(hippo_option('blog-title'));
}
if (is_singular('service')) {
$title = esc_html(get_the_title());
}
if (is_singular('portfolio')) {
$title = esc_html(get_the_title());
}
if (is_tax('portfolio-type')) {
$title = sprintf(esc_html__('%s', 'monsoon'), $query->name);
}
if (is_singular('team')) {
$title = esc_html(get_the_title());
}
if (is_singular('forum')) {
$title = esc_html(get_the_title());
}
if (is_singular('topic')) {
$title = esc_html(get_the_title());
}
if (is_singular('product')) {
$title = esc_html(get_the_title());
}
if (is_post_type_archive('product')) {
$title = esc_html(post_type_archive_title('', FALSE));
}
if (is_post_type_archive('forum')) {
$title = esc_html(post_type_archive_title('', FALSE));
}
if (is_post_type_archive('topic')) {
$title = esc_html(post_type_archive_title('', FALSE));
}
if (function_exists('bbp_is_single_user') and bbp_is_single_user()) {
$title = esc_html(get_the_title());
}
if (function_exists('bbp_is_reply_edit') and bbp_is_reply_edit()) {
$title = esc_html(get_the_title());
}
if (class_exists('WooCommerce')) {
if (is_product_category()) {
$title = sprintf(esc_html__('%s', 'monsoon'), $query->name);
}
if (is_product_tag()) {
$title = sprintf(esc_html__('%s', 'monsoon'), $query->name);
}
}
$title = apply_filters('hippo_title_text', $title, $title);
if (empty($title)) {
$title = esc_html(get_bloginfo('name'));
}
return $title;
}