當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wc_format_content函數代碼示例

本文整理匯總了PHP中wc_format_content函數的典型用法代碼示例。如果您正苦於以下問題:PHP wc_format_content函數的具體用法?PHP wc_format_content怎麽用?PHP wc_format_content使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了wc_format_content函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: woocommerce_category_archive_description

function woocommerce_category_archive_description()
{
    if (is_tax(array('product_cat', 'product_tag')) && get_query_var('paged') == 0) {
        $description = wc_format_content(term_description());
        $image = false;
        if (is_tax() || is_tag() || is_category()) {
            $term = get_queried_object();
            $thumbnail_id = absint(get_woocommerce_term_meta($term->term_id, 'thumbnail_id', true));
            if ($thumbnail_id) {
                $image = wp_get_attachment_image($thumbnail_id, 250);
            } else {
                $image = wc_placeholder_img_src();
            }
        }
        if ($description) {
            $string = '<div class="row margin-bottom">';
            if ($image) {
                $string .= '<div class="col-sm-4 col-sm-push-8">' . $image . '</div>';
            }
            $string .= '<div class="term-description col-sm-8';
            if ($image) {
                $string .= ' col-sm-pull-4';
            }
            $string .= '">' . $description . '</div></div>';
            echo $string;
        }
    }
}
開發者ID:n3ssi3,項目名稱:tauch-terminal,代碼行數:28,代碼來源:functions_woocommerce.php

示例2: woocommerce_product_archive_description

 /**
  * Show a shop page description on product archives.
  *
  * @subpackage	Archives
  */
 function woocommerce_product_archive_description()
 {
     if (is_post_type_archive('product') && 0 === absint(get_query_var('paged'))) {
         $shop_page = get_post(wc_get_page_id('shop'));
         if ($shop_page) {
             $description = wc_format_content($shop_page->post_content);
             if ($description) {
                 echo '<div class="page-description">' . $description . '</div>';
             }
         }
     }
 }
開發者ID:ahmedghazi,項目名稱:tpls,代碼行數:17,代碼來源:functions.php

示例3: custom_product_archive_description

 function custom_product_archive_description()
 {
     global $makeclean_theme_option;
     if (is_post_type_archive('product') && get_query_var('paged') == 0) {
         $shop_page = get_post(wc_get_page_id('shop'));
         if ($shop_page) {
             $description = wc_format_content($shop_page->post_content);
             if ($description) {
                 echo '<div class="page-description col-md-9 col-sm-8">' . $description . '</div> ';
             }
         }
     }
 }
開發者ID:khiconit,項目名稱:makeclean,代碼行數:13,代碼來源:functions.php

示例4: woocommerce_product_archive_description

 /**
  * Show a shop page description on product archives.
  *
  * @subpackage	Archives
  */
 function woocommerce_product_archive_description()
 {
     // Don't display the description on search results page
     if (is_search()) {
         return;
     }
     if (is_post_type_archive('product') && 0 === absint(get_query_var('paged'))) {
         $shop_page = get_post(wc_get_page_id('shop'));
         if ($shop_page) {
             $description = wc_format_content($shop_page->post_content);
             if ($description) {
                 echo '<div class="page-description">' . $description . '</div>';
             }
         }
     }
 }
開發者ID:woocommerce,項目名稱:woocommerce,代碼行數:21,代碼來源:wc-template-functions.php

示例5: wp_get_attachment_url

echo wp_get_attachment_url(get_post_thumbnail_id($shop_page->ID));
?>
');">
		<div class="seven columns">
			
		</div>
		<div class="five columns entry-content">
			<header class="entry-header">
				<h3 class="cl-white entry-title"><?php 
echo get_the_title($shop_page->ID);
?>
</h3>
			</header><!-- .entry-header -->
			
			<?php 
echo wc_format_content($shop_page->post_content);
?>
		</div>
		
		<?php 
wp_link_pages(array('before' => '<div class="page-links">' . esc_html__('Pages:', 'waterfront'), 'after' => '</div>'));
?>
	</div><!-- .entry-content -->
</section>
<section class="wrapper wave-border">
	<div class="row">
		<div class="ten columns centered text-center">
			<h3>Woody's Waterfront Online Gear</h3>
			<p>Here you can purchase watever it is we decide to sell online -- it's great!</p>
		</div>
	</div>
開發者ID:eliseoeric,項目名稱:woodys_waterfront,代碼行數:31,代碼來源:content.php

示例6: esc_url

		<a href="<?php 
echo esc_url($category_link);
?>
" class="product-category__image"><?php 
echo adventure_tours_render_category_thumbnail($category);
?>
</a>
		<div class="product-category__content">
		<?php 
printf('<h3 class="product-category__title"><a href="%s">%s</a></h3>', esc_url($category_link), esc_html($category->name));
?>
		<?php 
if ($category->description) {
    ?>
			<div class="product-category__description"><?php 
    echo wc_format_content($category->description);
    ?>
</div>
		<?php 
}
?>
		</div>
		<div class="product-category__info">
			<?php 
if ($category->count > 0) {
    ?>
				<div class="product-category__info__item"><?php 
    echo esc_html($category->count . ' ' . _n('tour', 'tours', $category->count, 'adventure-tours'));
    ?>
</div>
			<?php 
開發者ID:j-kenneth,項目名稱:Expeero,代碼行數:31,代碼來源:content-tour_category.php

示例7: is_tax

$cat_term = is_tax() ? get_queried_object() : null;
$display_mode = AtTourHelper::get_tour_archive_page_display_mode($cat_term ? $cat_term->term_id : 0);
?>

<?php 
ob_start();
?>
	<?php 
if ($is_first_page) {
    if ($cat_term) {
        echo wc_format_content($cat_term->description);
    } elseif (is_archive()) {
        $tours_page_id = adventure_tours_get_option('tours_page');
        $tours_page = $tours_page_id ? get_post($tours_page_id) : null;
        if ($tours_page && $tours_page->post_content) {
            echo wc_format_content($tours_page->post_content);
        }
    }
}
?>

	<?php 
if (have_posts()) {
    ?>

		<?php 
    $need_show_categories = $is_first_page && in_array($display_mode, array('both', 'subcategories'));
    $need_show_tours = in_array($display_mode, array('products', 'both'));
    $tours_display_style = $need_show_tours ? apply_filters('adventure_tours_get_tours_page_display_style', adventure_tours_get_option('tours_archive_display_style')) : '';
    ?>
開發者ID:j-kenneth,項目名稱:Expeero,代碼行數:30,代碼來源:archive.php

示例8: woocommerce_taxonomy_archive_description

/**
 * Overrides the default woocommerce_taxonomy_archive_description() function
 */
function woocommerce_taxonomy_archive_description()
{
    if (is_tax(array('product_cat', 'product_tag')) && get_query_var('paged') == 0) {
        global $wp_query;
        $term = $wp_query->get_queried_object();
        $thumbnail_id = get_woocommerce_term_meta($term->term_id, 'thumbnail_id', true);
        $image = wp_get_attachment_url($thumbnail_id);
        $image_class = $image ? ' has-term-image' : null;
        $description = wc_format_content(term_description());
        if ($description) {
            echo '<div class="term-description' . $image_class . '">' . $description . '</div>';
        }
    }
}
開發者ID:Wordpress-Development,項目名稱:ornea,代碼行數:17,代碼來源:extras.php


注:本文中的wc_format_content函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。