【发布时间】:2020-05-10 05:44:04
【问题描述】:
我正在尝试修改里面的一部分代码:themes / flatsome / inc / shortcodes / ux_products.php
我想改变这个:
<a href="<?php echo get_the_permalink(); ?>">
为此
<a href="<?php echo get_the_permalink(); ?>" aria-label="<?php echo get_the_title(); ?>">
我的子主题文件夹中有相同的路径和文件,但我无法取消主主题文件。
我意识到有另一个文件引用了我要取消的文件:themes / flatsome / inc / init.php:
if (is_woocommerce_activated()) {
require get_template_directory() . '/inc/shortcodes/ux_products.php'; //File to annul
require get_template_directory() . '/inc/shortcodes/ux_products_list.php';
require get_template_directory() . '/inc/shortcodes/product_flip.php';
require get_template_directory() . '/inc/shortcodes/product_categories.php';
if(get_theme_mod('product_layout') == 'custom') {
require get_template_directory() . '/inc/shortcodes/custom-product.php';
}
}
如何在不修改主题的情况下做到这一点(这可行但不正确)。
【问题讨论】:
标签: php wordpress woocommerce wordpress-theming