admin管理员组文章数量:1323348
I got an auction theme (adifier) and i'm trying to add a button to a specific ads category.
Tried a few codes but none seem to work, probably i don't know how to alter it properly. I got the category 3D Design where users should download the files that are uploaded from account page (where I should add another button with upload (I got I plugin with the upload button but don't know how to add it on the account page) ). Thanks in advance for any kind of help!
add_action( 'adifier_single_product_description', 'extra_button_on_product_page', 9 );
function extra_button_on_product_page() {
global $post, $product;
if ( has_term( 'accessories1-3d-design', 'product_cat' ) ) {
echo '<a class="button" href="www.test">Extra Button</a>';`
add_action( 'adifier_3d-design_description', 'extra_button_on_product_category_description', 9 );
function extra_button_on_product_category_description() {
if ( is_product_category('accessories1') ) {
echo '<a class="button" href="www.test">Extra Button</a>';
}
}
I got an auction theme (adifier) and i'm trying to add a button to a specific ads category.
Tried a few codes but none seem to work, probably i don't know how to alter it properly. I got the category 3D Design where users should download the files that are uploaded from account page (where I should add another button with upload (I got I plugin with the upload button but don't know how to add it on the account page) ). Thanks in advance for any kind of help!
add_action( 'adifier_single_product_description', 'extra_button_on_product_page', 9 );
function extra_button_on_product_page() {
global $post, $product;
if ( has_term( 'accessories1-3d-design', 'product_cat' ) ) {
echo '<a class="button" href="www.test">Extra Button</a>';`
add_action( 'adifier_3d-design_description', 'extra_button_on_product_category_description', 9 );
function extra_button_on_product_category_description() {
if ( is_product_category('accessories1') ) {
echo '<a class="button" href="www.test">Extra Button</a>';
}
}
Share
Improve this question
edited Sep 7, 2020 at 14:42
fuxia♦
107k38 gold badges255 silver badges459 bronze badges
asked Sep 7, 2020 at 11:04
Claudiu DumboClaudiu Dumbo
1
2 Answers
Reset to default 0You have added asterisk after the code. Here is the perfect code.
add_action( 'adifier_single_product_description', 'extra_button_on_product_page', 9 );
function extra_button_on_product_page() {
global $post, $product;
if ( has_term( 'accessories1-3d-design', 'product_cat' ) ) {
echo '<a class="button" href="www.test">Extra Button</a>';
add_action( 'adifier_3d-design_description', 'extra_button_on_product_category_description', 9 );
function extra_button_on_product_category_description() {
if ( is_product_category('accessories1') ) {
echo '<a class="button" href="www.test">Extra Button</a>';
}
}
Maybe this is the reason you are facing problem.
Those are 2 different codes that are supposed to do the same thing. I have tried like this too but no succes. In exchange i have installed woocommerce on a different host and with the next code i manage to make it work.
add_action('woocommerce_after_add_to_cart_button','cmk_additional_button');
function cmk_additional_button() { echo 'Download'; }
But i still don t know how to make it work on my adifier plugin. Sure is because of the location. My theme has instead of categoryy/products ...ads/categories. Next ...how can i access the account page? Thanks everyone!
本文标签: theme developmentAdding a button to wpaution plugin
版权声明:本文标题:theme development - Adding a button to wpaution plugin 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742133694a2422276.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论