简短描述模板为/模板/单个产品/简短描述。php:
<?php
/**
* Single product short description
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if ( ! defined( \'ABSPATH\' ) ) exit; // Exit if accessed directly
global $post;
if ( ! $post->post_excerpt ) return;
?>
<div itemprop="description">
<?php echo apply_filters( \'woocommerce_short_description\', $post->post_excerpt ) ?>
</div>
您可以覆盖此(或任何woo模板):
http://docs.woothemes.com/document/template-structure/ 通过将文件复制到主题中。。。所以
woocommerce/single-product/short-description.php
. 然后,您可以根据需要编辑它。
EDIT: 如果我理解你的问题,你会这样做:
<?php
/**
* Single product short description
*
* @author WooThemes
* @package WooCommerce/Templates
* @version 1.6.4
*/
if ( ! defined( \'ABSPATH\' ) ) exit; // Exit if accessed directly
global $post;
?>
<div itemprop="description">
Entre em contacto connosco para saber preços Aqui
</div>
或者你可以过滤
woocommerce_short_description
. 或者你可以自己定义
woocommerce_template_single_excerpt()
可插入的函数,或将其完全从挂钩中移除。确实有很多方法可以做到这一点,但模板覆盖往往是最容易理解的。
EDIT: Here\'s a very basic example of how to filter the short description (通常,过滤任何内容都是相同的过程)
Edit again: this goes in your theme\'s functions.php
function wpa_98244_filter_short_description( $desc ){
global $product;
if ( is_single( $product->id ) )
$desc .= \' add some extra text to the short description\';
return $desc;
}
add_filter( \'woocommerce_short_description\', \'wpa_98244_filter_short_description\' );