How to display product categories and number of sales on WooCommerce
Try looking in the Codex for answers. You will find that get_term_link() creates links to terms. foreach( $parents as $parent ) { echo get_term_link( $parent ); }
Try looking in the Codex for answers. You will find that get_term_link() creates links to terms. foreach( $parents as $parent ) { echo get_term_link( $parent ); }
The quickest and dirtiest way to do this is to add one line to the insert_posts() function, just before the $imported++; line: } add_post_meta( $post_id, ‘raw_import_data’, json_encode( $twitter_raw ) ); // NEW LINE (change 1001 to the image ID): set_post_thumbnail( $post_id, 1001 ); $imported++; } This will obviously disappear if you ever update the plugin. … Read more
WP native function get_queried_object() can help you to get an ID of a currently displayed term. WooCommerce then includes this handy function: woocommerce_get_term_top_most_parent() (originated here on WPSE btw,) that will get it’s top-level parent term. I haven’t tested the following code but it should provide a good starting point: if ( ‘wedgwood’ == woocommerce_get_term_top_most_parent( get_queried_object()->term_id … Read more
If CAS is the only login method, I think your blog should be protected. But, the atackers don’t care about alternative login methods. They simply send request against wp-login.php. So if you still have an account named “admin”, CAS cannot protect your blog. Let’s think about the worst case. Assuming you have an account named … Read more
These are actually two questions. The second question – how to add categories to attachments – is already answered. How to restrict uploading attachment to a specific role? The capability to do that is named upload_files in WordPress. Some roles have this capability by default: authors, editors, administrators. I would restrict it to editors and … Read more
I cannot comment, I would if I could, but I can’t, please don’t down-vote Could you not just use 1 shortcode with a parameter, e.g. instead of create one for each gallery image-gallery-1,image-gallery-2 etc, you could just use the ID as a parameter: image-gallery 1, image-gallery 2 … Then in your handling function you can … Read more
This does not have anything to do with cookies, this is what happends: 1. Visitor goes to page 4/6 wich shows products 40-50 (10 per page) 2. When visitor changes products per page from 10 to 30, he will still be at page 4, when there are only 2 pages (60 products / 30 = … Read more
If you use a custom theme, you can create your own shop/form-login.php, and Woocommerce will use that. Then you can change the class names or add custom JavaScript. Upgrades for the core are still possible.
Any changes you make to the plugin’s stylesheet will be overwritten when you update the plugin. Likewise with an edit to the theme’s stylesheet. Even if you create your own stylesheet and enqueue it via functions.php you will have redo the enqueueing when you update. Of course, if this is a theme (or child theme) … Read more
How often do the results change? I think the results are finally and did not change often (or never). Maybe it is better to use a file caching then using output buffering. Write the results to a file and append a hash or date to the filename as indicator. If the results are updated or … Read more