本文整理汇总了PHP中woocommerce_page_title函数的典型用法代码示例。如果您正苦于以下问题:PHP woocommerce_page_title函数的具体用法?PHP woocommerce_page_title怎么用?PHP woocommerce_page_title使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了woocommerce_page_title函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cpotheme_page_title
function cpotheme_page_title()
{
global $post;
if (isset($post->ID)) {
$current_id = $post->ID;
} else {
$current_id = false;
}
$title_tag = function_exists('is_woocommerce') && is_woocommerce() && is_singular('product') ? 'span' : 'h1';
echo '<' . $title_tag . ' class="pagetitle-title heading">';
if (function_exists('is_woocommerce') && is_woocommerce()) {
woocommerce_page_title();
} elseif (is_category() || is_tag() || is_tax()) {
echo single_tag_title('', true);
} elseif (is_author()) {
the_author();
} elseif (is_date()) {
_e('Archive', 'brilliance');
} elseif (is_404()) {
echo __('Page Not Found', 'brilliance');
} elseif (is_search()) {
echo __('Search Results for', 'brilliance') . ' "' . get_search_query() . '"';
} else {
echo get_the_title($current_id);
}
echo '</' . $title_tag . '>';
}
示例2: ultra_display_woocommerce_page_title
/**
* Output the WooCommerce page titles to custom location.
*/
function ultra_display_woocommerce_page_title()
{
if (is_singular('product')) {
woocommerce_template_single_title();
} else {
echo '<h1 class="entry-title">';
woocommerce_page_title();
echo '</h1>';
}
}
示例3: square_theme_wrapper_start
function square_theme_wrapper_start()
{
echo '<header class="sq-main-header">';
echo '<div class="sq-container">';
echo '<h1 class="sq-main-title">';
woocommerce_page_title();
echo '</h1>';
do_action('sq_woocommerce_archive_description');
echo '</div>';
echo '</header>';
echo '<div class="sq-container">';
echo '<div id="primary">';
}
示例4: tokopress_shop_description
function tokopress_shop_description()
{
$output = '';
ob_start();
if (of_get_option('tokopress_wc_hide_products_header')) {
echo '<h1 class="page-title">';
woocommerce_page_title();
echo '</h1>';
}
do_action('woocommerce_archive_description');
$output .= ob_get_clean();
if ($output) {
echo '<div class="shop_description">' . $output . '</div>';
}
}
示例5: get_title
public function get_title()
{
$separator = $this->title_separator;
$use_wp_title = $this->use_wp_title_function;
// Disabling 'title-tag' feature.
$activate_title_tag_back = false;
if ($use_wp_title && get_theme_support('title-tag')) {
remove_theme_support('title-tag');
$activate_title_tag_back = true;
}
$q = $GLOBALS['wp_query'];
if ($q->get('wc_query') && function_exists('woocommerce_page_title')) {
if ($separator) {
$separator = '';
}
$title = woocommerce_page_title(false);
} else {
$is_home = is_home();
$is_front_page = is_front_page();
if ($is_home || $is_front_page) {
if ($is_home && $is_front_page) {
$title = get_bloginfo('name');
} elseif ($is_home) {
$title = get_the_title(get_option('page_for_posts'));
} elseif ($is_front_page) {
$title = get_the_title(get_option('page_on_front'));
}
} else {
if ($use_wp_title) {
$title = wp_title($separator, false);
} else {
$title = is_singular() ? get_the_title(get_queried_object()) : strip_tags(get_the_archive_title());
}
}
}
// Restoring 'title-tag' feature.
if ($activate_title_tag_back) {
// add_theme_support( 'title-tag' );
$GLOBALS['_wp_theme_features']['title-tag'] = true;
}
if ($title) {
if ($separator) {
$title = substr($title, strlen($separator) + 1);
}
$title = trim($title);
}
return $title;
}
示例6: store_single_custom_header
function store_single_custom_header()
{
if (apply_filters('woocommerce_show_page_title', true)) {
?>
<div class="header-title col-md-12">
<span><?php
woocommerce_page_title();
?>
</span>
</div>
<?php
}
?>
<div id="primary-mono" class="content-area <?php
do_action('store_primary-width');
?>
">
<main id="main" class="site-main" role="main">
<?php
}
示例7: anaglyph_woo_page_title
function anaglyph_woo_page_title()
{
global $anaglyph_config;
if (apply_filters('woocommerce_show_page_title', true)) {
?>
<!-- Page Title -->
<section id="page-title">
<div class="title">
<?php
if (is_single()) {
?>
<h1 class="reset-margin"><?php
the_title();
?>
</h1>
<?php
} else {
?>
<h1 class="reset-margin"><?php
woocommerce_page_title();
?>
</h1>
<?php
}
?>
</div>
<?php
if (!empty($anaglyph_config['shopheader-image'])) {
$simg = $anaglyph_config['shopheader-image'];
echo '<img src="' . esc_url($simg['url']) . '" class="parallax-bg" alt="">';
}
?>
</section>
<!-- end Page Title -->
<?php
}
}
示例8: dazzling_wrapper_start
function dazzling_wrapper_start() {
echo '<div class="header-title" style="padding-top: 10px; padding-bottom: 10px;">';
echo '<div class="container">';
echo '<div id="primary" class="content-area col-sm-12 col-md-6">';
echo '<h1 class="entry-title" style="display: inline-block">';
global $current_user;
$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
if(is_product()){
the_title();
if($user_role=="wholesale_customer"){
echo " ".get_post_meta( get_the_ID(), 'pharmacies_slug', true );
}
}
else if(is_shop()){
if($user_role=="wholesale_customer"){
echo "Pharmacy ";
}
woocommerce_page_title();
}
else{
woocommerce_page_title();
}
echo '</h1>';
if(is_shop()){
if($user_role=="wholesale_customer"){
echo '<img style="float: right;" src="'.get_home_url().'/resources/uploads/2015/08/freeshipping_new_pharmacy.png"/>';
}
else{
echo '<img style="float: right;" src="'.get_home_url().'/resources/uploads/2015/08/freeshipping_new.png"/>';
}
}
echo '</div>';
echo '<div id="primary" class="content-area col-sm-12 col-md-6">';
if(is_shop()){
$taxonomy = 'product_cat';
$orderby = 'name';
$show_count = 0; // 1 for yes, 0 for no
$pad_counts = 0; // 1 for yes, 0 for no
$hierarchical = 1; // 1 for yes, 0 for no
$title = '';
$empty = 0;
$args = array(
'taxonomy' => $taxonomy,
'orderby' => $orderby,
'show_count' => $show_count,
'pad_counts' => $pad_counts,
'hierarchical' => $hierarchical,
'title_li' => $title,
'hide_empty' => $empty
);
echo "<span class='cat_nav'>";
$all_categories = get_categories( $args );
//print_r($all_categories);
$x=1;
foreach ($all_categories as $cat) {
if($x ==1 ){
if($cat->category_parent == 0) {
echo "<a href='#products_categories_row_$cat->term_id'>".$cat->name."</a>";
}
}
else{
if($cat->category_parent == 0) {
echo " | <a href='#products_categories_row_$cat->term_id'>".$cat->name."</a>";
}
}
$x++;
}
echo "</span>";
}
else{
echo '<img src="http://174.121.78.227/~kmxmarketing/resources/uploads/2015/08/freeshipping_new.png"/>';
}
echo '</div></div></div>';
echo '<div class="site-content container">';
echo '<div id="primary" class="content-area col-sm-12 col-md-12">';
echo '<main id="main" class="site-main" role="main">';
}
示例9: dt_woocommerce_get_page_title
/**
* Wrap for woocommerce_page_title( false ).
*
* @param string $title
* @return string
*/
function dt_woocommerce_get_page_title($title = '')
{
return woocommerce_page_title(false);
}
示例10: while
<?php
while (have_posts()) {
the_post();
wc_get_template_part('content', 'product');
}
?>
<?php
$next_link = get_next_posts_link(__('More', 'woocommerce'), '');
echo str_replace('<a ', '<a data-rel="post-list" ' . implode(' ', $attr) . ' class="button-more ' . esc_attr($load_more_class) . '" ', $next_link);
?>
<?php
} else {
$current_page_title = woocommerce_page_title(false);
get_header('shop');
list($has_sidebar, $sidebar_position, $sidebar_area) = xt_setup_dynamic_sidebar($shop_page_id);
?>
<div class="row in-container">
<!-- Main Content -->
<div class="small-12 medium-<?php
echo $has_sidebar ? '6' : '12';
?>
large-<?php
echo $has_sidebar ? '8' : '12';
?>
column">
示例11: get_header
* @version 2.0.0
*/
if (!defined('ABSPATH')) {
exit;
}
// Exit if accessed directly
global $smof_data;
get_header($smof_data['ts_header_layout']);
$extra_class = "";
$page_column_class = ts_page_layout_columns_class($smof_data['ts_prod_cat_layout']);
$show_breadcrumb = get_post_meta(wc_get_page_id('shop'), 'ts_show_breadcrumb', true);
$show_page_title = apply_filters('woocommerce_show_page_title', true) && get_post_meta(wc_get_page_id('shop'), 'ts_show_page_title', true);
if ($show_breadcrumb && isset($smof_data['ts_breadcrumb_layout'])) {
$extra_class = 'show_breadcrumb_' . $smof_data['ts_breadcrumb_layout'];
}
ts_breadcrumbs_title($show_breadcrumb, $show_page_title, woocommerce_page_title(false));
$show_top_content_widget_area = is_active_sidebar('product-category-top-content') && $smof_data['ts_prod_cat_top_content'];
?>
<div class="page-container <?php
echo esc_attr($extra_class);
?>
">
<!-- Left Sidebar -->
<?php
if ($page_column_class['left_sidebar']) {
?>
<aside id="left-sidebar" class="ts-sidebar <?php
echo esc_attr($page_column_class['left_sidebar_class']);
?>
">
示例12: extra_woocommerce_output_content_wrapper
function extra_woocommerce_output_content_wrapper()
{
echo '
<div id="main-content">
<div class="container">
<div id="content-area" class="clearfix">
<div class="et_pb_row woocommerce-page-top">';
if (!is_singular('product')) {
echo '<h1 class="page-title">' . woocommerce_page_title(false) . '</h1>';
}
woocommerce_breadcrumb();
echo ' </div>
<div class="et_pb_extra_column_main">';
}
示例13: dt_woocommerce_title_controller
/**
* Title controller.
*
*/
function dt_woocommerce_title_controller()
{
$config = Presscore_Config::get_instance();
$title_mode = $config->get('header_title');
if ('disabled' != $title_mode) {
$title_align = of_get_option('general-title_align', 'center');
$title_classes = array('page-title');
switch ($title_align) {
case 'right':
$title_classes[] = 'title-right';
break;
case 'left':
$title_classes[] = 'title-left';
break;
default:
$title_classes[] = 'title-center';
}
$before_title = '<div class="' . esc_attr(implode(' ', $title_classes)) . '"><div class="wf-wrap"><div class="wf-table">';
$after_title = '</div></div></div>';
$breadcrumbs = apply_filters('dt_sanitize_flag', of_get_option('general-show_breadcrumbs', 1));
echo $before_title;
if ('right' == $title_align) {
if ($breadcrumbs) {
echo presscore_get_breadcrumbs();
}
echo '<div class="wf-td"><h1>';
woocommerce_page_title();
echo '</h1></div>';
} else {
echo '<div class="wf-td"><h1>';
woocommerce_page_title();
echo '</h1></div>';
if ($breadcrumbs) {
echo presscore_get_breadcrumbs();
}
}
echo $after_title;
}
}
示例14: miss_woocommerce_content
function miss_woocommerce_content()
{
if (is_singular('product')) {
while (have_posts()) {
the_post();
woocommerce_get_template_part('content', 'single-product');
}
} else {
?>
<?php
if (apply_filters('woocommerce_show_page_title', true)) {
?>
<div class="bread-container">
<div class="bread-wrapper">
<div class="blog-title"><?php
woocommerce_page_title();
?>
</div>
<?php
dimox_breadcrumbs();
?>
</div>
</div>
<?php
}
?>
<?php
do_action('woocommerce_archive_description');
?>
<?php
if (have_posts()) {
?>
<?php
do_action('woocommerce_before_shop_loop');
?>
<?php
woocommerce_product_loop_start();
?>
<?php
woocommerce_product_subcategories();
?>
<?php
while (have_posts()) {
the_post();
?>
<?php
woocommerce_get_template_part('content', 'product');
?>
<?php
}
// end of the loop.
?>
<?php
woocommerce_product_loop_end();
?>
<?php
do_action('woocommerce_after_shop_loop');
?>
<?php
} elseif (!woocommerce_product_subcategories(array('before' => woocommerce_product_loop_start(false), 'after' => woocommerce_product_loop_end(false)))) {
?>
<?php
woocommerce_get_template('loop/no-products-found.php');
?>
<?php
}
}
}
示例15: dh_page_title
function dh_page_title($echo = true)
{
$title = "";
if (is_category()) {
$title = single_cat_title('', false);
} elseif (is_day()) {
$title = __('Archive for date:', DH_DOMAIN) . " " . get_the_time('F jS, Y');
} elseif (is_month()) {
$title = __('Archive for month:', DH_DOMAIN) . " " . get_the_time('F, Y');
} elseif (is_year()) {
$title = __('Archive for year:', DH_DOMAIN) . " " . get_the_time('Y');
} elseif (is_search()) {
global $wp_query;
if (!empty($wp_query->found_posts)) {
if ($wp_query->found_posts > 1) {
$title = $wp_query->found_posts . " " . __('search results for', DH_DOMAIN) . ' <span class="search-query">' . esc_attr(get_search_query()) . '</span>';
} else {
$title = $wp_query->found_posts . " " . __('search result for', DH_DOMAIN) . ' <span class="search-query">' . esc_attr(get_search_query()) . '</span>';
}
} else {
if (!empty($_GET['s'])) {
$title = __('Search results for', DH_DOMAIN) . ' <span class="search-query">' . esc_attr(get_search_query()) . '</span>';
} else {
$title = __('To search the site please enter a valid term', DH_DOMAIN);
}
}
} elseif (is_author()) {
$curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author'));
if (isset($curauth->nickname)) {
$title = $curauth->nickname;
}
} elseif (is_tag()) {
$title = single_tag_title('', false);
} elseif (is_tax()) {
$term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy'));
$title = $term->name;
} elseif (is_front_page() && !is_home()) {
$title = get_the_title(get_option('page_on_front'));
} elseif (is_home() && !is_front_page()) {
$title = get_the_title(get_option('page_for_posts'));
} elseif (is_404()) {
$title = __('404 - Page not found', DH_DOMAIN);
} else {
$title = get_the_title();
}
if (isset($_GET['paged']) && !empty($_GET['paged'])) {
$title .= " (" . __('Page', DH_DOMAIN) . " " . $_GET['paged'] . ")";
}
if (defined('WOOCOMMERCE_VERSION') && is_woocommerce() && (is_product() || is_shop()) && !is_search()) {
// if( ! is_product() ) {
// $title = woocommerce_page_title( false );
// }else{
// $title =
// }
$title = woocommerce_page_title(false);
}
if (is_post_type_archive('portfolio')) {
$title = esc_html(dh_get_theme_option('portfolio-archive-title', __('My Portfolio', DH_DOMAIN)));
}
if ($echo) {
echo dhecho($title);
} else {
return $title;
}
}