Visual Composer Data Source?

时间:2017-07-20 作者:amy-gr8njr

所以,我所要做的就是从WooCommerce获取我的产品类别,并以Visual Composer Masonry格式发布在页面上。但是(正如您在图片中看到的那样),数据源选项中的产品类别被遮住了。当我输入它时,什么也不显示。

屏幕截图:screenshot

我基本上只想要一个砖石网格,带有链接到类别页面的帖子类别特征图像。

1 个回复
SO网友:Kendall

我在woocommerce文件的原始类别模板中找到了这个。

<?php
/**
 * The template for displaying product category thumbnails within loops
 *
 * This template can be overridden by copying it to yourtheme/woocommerce/content-product_cat.php.
 *
 * HOWEVER, on occasion WooCommerce will need to update template files and you
 * (the theme developer) will need to copy the new files to your theme to
 * maintain compatibility. We try to do this as little as possible, but it does
 * happen. When this occurs the version of the template file will be bumped and
 * the readme will list any important changes.
 *
 * @see     https://docs.woocommerce.com/document/template-structure/
 * @author  WooThemes
 * @package WooCommerce/Templates
 * @version 2.6.1
 */

if ( ! defined( \'ABSPATH\' ) ) {
    exit;
}
?>
<li <?php wc_product_cat_class( \'\', $category ); ?>>
    <?php
    /**
     * woocommerce_before_subcategory hook.
     *
     * @hooked woocommerce_template_loop_category_link_open - 10
     */
    do_action( \'woocommerce_before_subcategory\', $category );

    /**
     * woocommerce_before_subcategory_title hook.
     *
     * @hooked woocommerce_subcategory_thumbnail - 10
     */
    do_action( \'woocommerce_before_subcategory_title\', $category );

    /**
     * woocommerce_shop_loop_subcategory_title hook.
     *
     * @hooked woocommerce_template_loop_category_title - 10
     */
    do_action( \'woocommerce_shop_loop_subcategory_title\', $category );

    /**
     * woocommerce_after_subcategory_title hook.
     */
    do_action( \'woocommerce_after_subcategory_title\', $category );

    /**
     * woocommerce_after_subcategory hook.
     *
     * @hooked woocommerce_template_loop_category_link_close - 10
     */
    do_action( \'woocommerce_after_subcategory\', $category ); ?>
</li>

结束

相关推荐

Customize profile.php

使用插件“高级自定义字段”:https://wordpress.org/plugins/advanced-custom-fields/我可以将自定义字段添加到配置文件中。php。But how do I remove the default elements from profile.php (Personal Options, Name, etc.)?我知道我可以在我的子主题中创建新的模板文件来覆盖页面的外观,但我找不到如何使用配置文件来实现这一点。php。我开始使用CSS来隐藏元素,除了没有类或ID的