如何编辑 Woocommerce Single Product Meta 模板中显示的内容? [英] How to edit what's displayed in the Woocommerce Single Product Meta template?

查看:26
本文介绍了如何编辑 Woocommerce Single Product Meta 模板中显示的内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为客户做一些工作并使用 wordpress/woocommerce,他们要求我将类别移动到我已经完成的单个产品页面上的产品名称正下方,但他们不想要它要打印类别:类别 1、类别 2 等...",他们希望删除类别:",它实际上只是列出没有标签的类别名称.

I'm doing some work for a client and using wordpress / woocommerce, they asked me to move the categories to be located directly under the product name on a single product page which I have done, but they don't want it to print "categories: category 1, category 2 etc..." they would like the "categories:" removed and it to just actually lists the names of the categories without the label.

通常这很容易,但我无法在任何生成其中的 div 的地方找到 PHP.它带有嵌套在 中的 <div class="post_in"><div class="product_meta">.

Normally this would be easy enough but I cant find the PHP anywhere that generates the divs that are in. Its with <div class="post_in"> which is nested in <div class="product_meta">.

如果这有所作为,我们将使用主题森林中的零售商"主题.你可以在 http://www.sophieferreira.com/?product=down-the-rabbit-hole-onyx-print

We are using "The Retailer" theme from theme forest if that makes a difference. You can see an example of what im talking about at http://www.sophieferreira.com/?product=down-the-rabbit-hole-onyx-print

推荐答案

您使用的是最新版本的 WooCommerce 吗?如果是这样,请查看您的插件文件夹并导航到woocommerce -> 模板 -> 单一产品 -> meta.php".查看第 27 行,您应该至少看到一个正在创建它的位置.尝试编辑该行,看看它是否适合您.

Are you using the most current version of WooCommerce? If so, look in your plugins folder and navigate to "woocommerce -> templates -> single-product -> meta.php". Look on line 27 and you should see at least one location where this is being created. Try to edit that line and see if it works for you.

请记住,无论何时您编辑 WooCommerce 模板文件,您都应该将它们移动到您的主题文件夹中.这样,您仍然可以更新 WooCommerce,而不会覆盖您的编辑.您可以通过覆盖以升级安全的方式编辑这些文件.只需将其复制到您的主题中名为/woocommerce 的目录中,保持相同的文件结构,但不包括 templates 文件夹.因此,要覆盖 meta.php 文件,主题文件夹内的结构将是:woocommerce -> single-product -> meta.php

Keep in mind, anytime you are editing the WooCommerce template files you should move them into your theme folder. This way you will still be able to update WooCommerce without overwriting your edits. You can edit these files in an upgrade safe way through overrides. Simply copy it into a directory within your theme named /woocommerce, keeping the same file structure except you don't include the templates folder. So to override the meta.php file the structure inside of theme folder would be: woocommerce -> single-product -> meta.php

这篇关于如何编辑 Woocommerce Single Product Meta 模板中显示的内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆