本文整理汇总了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;未经允许,请勿转载。 |
请发表评论