wordpress woocommerce 模板文件覆盖 [英] wordpress woocommerce template file overiding

查看:31
本文介绍了wordpress woocommerce 模板文件覆盖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 woocommerce 来开发电子商务商店.woocommerce 一切正常.但我有一个问题.因为我想在产品页面(基于商店的页面)中显示一些带有一些文本的自定义图像.因此,我认为 wordpress 高级自定义字段 会很好.我让它安装.现在我需要提取模板文件中的图像.但是通过使用 woocommerce 插件,我发现它不使用 wordpress 模板.Woocommerce 自己生成总页面(生产者页面).我想从 wordpress 高级自定义字段 插件中显示一些自定义字段.那么有人可以告诉我如何做到这一点吗?任何帮助和建议将是非常可观的.谢谢...

I am using woocommerce to develop an ecommerce store. Everything is fine with woocommerce. But I have one problem. As because I want to show some custom images with some texts in the product page(shop based page). So for that I thought wordpress advanced custom fields will be good. I made it install. And now I need to extract the image in the template file. But by going through woocommerce plugin I got that it doesn't use the wordpress template. Woocommerce is generating the total page (producr page) by itself. And Iwant to show some custom fields from wordpress advanced custom fields plugin. So can someone kindly tell me how to do this? Any help and suggestions will be really appreciable. Thanks...

我希望显示所有产品的 woocommerce 商店页面应该使用我自己的自定义模板.这样我就可以在那里使用 wordpress 高级自定义字段代码

推荐答案

为了覆盖 wp-content/plugins/woocommerce/templates 中的 Woocommerce 模板,请在wp-content/themes/<你的主题>/woocommerce.它将被用来代替原来的.

In order to override a Woocommerce template from wp-content/plugins/woocommerce/templates, create a file with the same name in wp-content/themes/<your theme>/woocommerce. It will be used instead of the original one.

如果您查看其中一个原始模板文件,您会实际上在顶部的评论中找到此说明:

If you look at one of the original template files, you will actually find this instruction in a comment at the top:

通过将其复制到 yourtheme/woocommerce/single-product.php 来覆盖此模板

Override this template by copying it to yourtheme/woocommerce/single-product.php

这篇关于wordpress woocommerce 模板文件覆盖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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