wordpress-theming

How to change “add to cart” in WooCommerce?

大城市里の小女人 提交于 2020-05-14 14:20:05
问题 I wanna use <ul> <li> instead of <select> <option> I enter this code in function.php but doesn't work: function wc_dropdown_variation_attribute_options( $args = array() ) { . . . $html = '<div class="tt-wrapper"><div class="tt-title-options">اندازه:</div><ul id="' . esc_attr( $id ) . '" class="tt-options-swatch options-large ' . esc_attr( $class ) . '" name="' . esc_attr( $name ) . '" data-attribute_name="attribute_' . esc_attr( sanitize_title( $attribute ) ) . '" data-show_option_none="' . (

How to change “add to cart” in WooCommerce?

坚强是说给别人听的谎言 提交于 2020-05-14 14:15:14
问题 I wanna use <ul> <li> instead of <select> <option> I enter this code in function.php but doesn't work: function wc_dropdown_variation_attribute_options( $args = array() ) { . . . $html = '<div class="tt-wrapper"><div class="tt-title-options">اندازه:</div><ul id="' . esc_attr( $id ) . '" class="tt-options-swatch options-large ' . esc_attr( $class ) . '" name="' . esc_attr( $name ) . '" data-attribute_name="attribute_' . esc_attr( sanitize_title( $attribute ) ) . '" data-show_option_none="' . (

Wordpress Flynt Theme. I got the issue as 'resource not found' after npm run build

泪湿孤枕 提交于 2020-04-17 21:30:49
问题 For production, I did npm run build at Wordpress Flynt Theme. but by changing the resource name, I got the 'resource not found' error. So, I would like not to change the file name of fonts and images. How can I resolve this issue? 来源: https://stackoverflow.com/questions/61191197/wordpress-flynt-theme-i-got-the-issue-as-resource-not-found-after-npm-run-bui

Wordpress use index.php instead of single.php to show post

£可爱£侵袭症+ 提交于 2020-03-24 06:43:49
问题 My Wordpress websites are not using single.php to show posts on the website. Every time I open a post, it opens it in index.php. My single.php looks like this <?php get_header(); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <? echo the_content(); ?> <? endwhile; endif; ?> <? get_footer(); ?> How can I fix this? 回答1: I had the same problem with neither the single-CUSTOM-TYPE.php nor the single.php being rendered after clicking the single-post-link.... only index.php

Wordpress use index.php instead of single.php to show post

扶醉桌前 提交于 2020-03-24 06:43:02
问题 My Wordpress websites are not using single.php to show posts on the website. Every time I open a post, it opens it in index.php. My single.php looks like this <?php get_header(); ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <? echo the_content(); ?> <? endwhile; endif; ?> <? get_footer(); ?> How can I fix this? 回答1: I had the same problem with neither the single-CUSTOM-TYPE.php nor the single.php being rendered after clicking the single-post-link.... only index.php

How can I add html code on WooCommerce after single product summary

喜夏-厌秋 提交于 2020-03-14 05:35:30
问题 How can I add HTML code on woocommerce after a single product summary? Here is the screenshot: Regards Golam Rabbi 回答1: add_action( 'woocommerce_product_after_tabs', 'my_product_after_tabs' ); function my_product_after_tabs() { echo 'html'; } Or when overwriting and adjusting https://github.com/woocommerce/woocommerce/blob/master/templates/single-product/tabs/tabs.php https://github.com/woocommerce/woocommerce/blob/master/templates/single-product/related.php 回答2: add_action( 'woocommerce

How can I add html code on WooCommerce after single product summary

限于喜欢 提交于 2020-03-14 05:35:01
问题 How can I add HTML code on woocommerce after a single product summary? Here is the screenshot: Regards Golam Rabbi 回答1: add_action( 'woocommerce_product_after_tabs', 'my_product_after_tabs' ); function my_product_after_tabs() { echo 'html'; } Or when overwriting and adjusting https://github.com/woocommerce/woocommerce/blob/master/templates/single-product/tabs/tabs.php https://github.com/woocommerce/woocommerce/blob/master/templates/single-product/related.php 回答2: add_action( 'woocommerce

Make Tesseract theme header fixed for all pages

荒凉一梦 提交于 2020-03-06 03:12:17
问题 I'm constructing a website using the Tesseract theme by Tyler Moore. I want to make the header fixed and 80% opaque for every page of the website. The header for the home page has a slider for transparency under customization and I managed to make it fixed by changing its position by editing the site-banner css file in cpanel. My question is, how can I apply the same setting to all the other pages of my website? Thank you in advance! 回答1: On the wordpress dashbord, hover on the appearance tab

Calling a function in a custom php template in Wordpress

前提是你 提交于 2020-02-02 19:57:27
问题 I want to call a function which is in another php class that I wrote in Wordpress. However I'm confused about the syntax, e.g. to get the header on a page you just call get_header(); etc. But how do i call a function in a specific class? For example in index.php I want to call a function named this_function() which reside in say test.php. What is the syntax for this? I suspect it to be very simple, but I can't get the syntax right, and I can't any help online. Thanks 回答1: First use require

Get current category ID of the active page

烂漫一生 提交于 2020-01-27 08:54:27
问题 Looking to pull the category ID of a specific page in WordPress that is listing all posts using that specific category. Tried the below but not working. I am able to get the category name using single_term_title . $category = single_term_title("", false); $catid = get_cat_ID( $category ); $category is displaying "Entertainment" for example. But I also need the ID of "Entertainment". How would I go about this? 回答1: You can try using get_the_category(): $categories = get_the_category();