【问题标题】:Woocommerce shop page custom cssWoocommerce商店页面自定义css
【发布时间】:2015-04-13 01:11:39
【问题描述】:

我是 woocommerce 新手。我在产品列表中遇到问题,当我添加短代码时它显示 woocommerce html、类列表,但我想显示我的 html、css 我试过但它不起作用,这里是woocommerce 代码..

<ul class="products">
    <li class="post-22 product type-product status-publish has-post-thumbnail first shipping-taxable purchasable product-type-simple product-cat-featured instock">
    <a href="http://localhost/wordpress/?product=mac-2">
        <img src="http://localhost/wordpress/wp-content/uploads/2015/02/2-240x300-240x300.jpg" class="attachment-shop_catalog wp-post-image" alt="2-240x300" height="300" width="240">
        <h3>Mac 2</h3>
    <span class="price"><span class="amount">£50.00</span></span>
    </a>
    <a href="/wordpress/?orderby=popularity&amp;post_type=product&amp;add-to-cart=22" rel="nofollow" data-product_id="22" data-product_sku="" data-quantity="1" class="button add_to_cart_button product_type_simple">Add to cart</a>
</li>

这是我的代码..

<div class="box-product product-carousel" id="featured-tab-carousel">
  <div class="slider-item">
    <div>
<div class="product-block" id="element_change">                   
  <div class="product-block-inner">
<div class="product-image-block">
  <?php echo do_shortcode('[product_category category="featured" per_page="12" columns="4" orderby="default" order="ASC"]');?>
  <div class="product-hover-block">
<div class="add-to-link">
 <div class="cart">
 <input type="button" value="Add to Cart" onclick="addToCart('43');" class="button" />
<em>Add to Cart</em>
  </div>
 <div class="wishlist"><a onclick="addToWishList('43');">Add to Wish List</a>
    <em>Add to Wish List</em>
  </div>
<div class="compare"><a onclick="addToCompare('43');">Add to Compare</a>
 <em>Add to Compare</em>
 </div>
</div>
<div class="rating"><img src="<?php echo get_template_directory_uri();?>/catalog/view/theme/OPC080180/<?php echo get_template_directory_uri();?>/image/stars-0.png" alt="Based on 0 reviews." /></div>  </div>
  </div>
 <div class="product_category_title"> - Software</div>
<div class="name"><a href="indexb8ca.html?route=product/product&amp;product_id=43">MacBook</a></div>
 <div class="product_info">
<div class="price">$589.50                                                  </div>
</div></div></div>

请帮助我如何更改 css...

【问题讨论】:

    标签: wordpress woocommerce wordpress-theming


    【解决方案1】:

    据说这是为 Woocommerce 添加自定义 CSS 样式表的一种方式:

    function enqueue_style_after_wc() {
        $deps = class_exists( 'WooCommerce' ) ? array( 'woocommerce-layout', 'woocommerce-smallscreen', 'woocommerce-general' ) : array();
        wp_enqueue_style( 'my-style', 'my-style.css', $deps, '1.0' );
    }
    add_action( 'wp_enqueue_scripts', 'enqueue_style_after_wc' );
    

    来源: https://wordpress.stackexchange.com/questions/135171/woocommerce-include-custom-stylesheet-after-woocommerce-styling

    【讨论】:

      猜你喜欢
      • 2016-09-21
      • 1970-01-01
      • 1970-01-01
      • 2016-10-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-30
      • 2020-11-17
      • 2019-12-22
      相关资源
      最近更新 更多