I have the product categories navbar on top of the shop page. If I click on any of the category navbar, then it take me to the product-categories page, however, on top of this page, the categories …
Tag: wordpress
Get on sale dates for the variations of a WooCommerce variable product
Is there any way to get on_sale_from and on_sale_to dates for WooCommerce variable products in an array using PHP? The highlighted red boxes in this screenshot:
WP Get IDs of parent categories only
The snippet below works fine but I’ve hard coded the parent categories IDs, Now I’m looking for a way to get rid of hard coded IDs. Answer If 0 is passed, only top-level terms are returned.
Display sub subcategories terms list on WooCommerce subcategory archive pages
In Woocommerce I use Get the subcategories of the current product category in Woocommerce archives answer function, to display a list of subcategories on the parent category pages But I only need to …
WooCommerce: Get URL of paged shop archive
I need the link to the paged shop archive URL to add it as rel=canonical. As default WooCommerce seems to use always the URL of the “All products” page. For example: The all product archive page has the following URL: If I go to page 2, the URL is still the one from above. But the correct version …
WooCommerce: Remove “Products” archive from Yoast breadcrumbs
I want to remove the link to the products archive in the breadcrumbs on all pages. To do that, I found a solution in the Yoast docs. It works fine except on the product pages. Here’s my current code: It removes the link on archive pages and all other WooCommerce pages as you would expect by the conditio…
Passing a class, method and arguments to WordPress functions
When adding pages to the WordPress admin you use add_menu_page, which accepts a callable function/method. My issue is, I’m a little stumped on how to pass an argument to bar when it accepts/expects parameters, for example: I’ve tried a couple different approaches but I can’t seem to get it t…
Display the WooCommerce product price (with discount) in a custom template
I need to display a product in a specific template. Here is the template code:
Dynamic ID with JQUERY functions
I have a problem with my JQUERY code. Here’s the code: $maxcounter = $( ‘.testimonio-popup[id^=”popup-“]’ ).length; var i = 0; while (i < $maxcounter) { $('#open-'+i).on('click', …
WordPress on Docker behind nginx reverse proxy using SSL
Here is my problem, I need to install a wordpress application on a subdirectory url (“https://test.com/blog/”). Since my whole environment is running on Docker, I decided to do the same with the wordpress app. To start it as simple as possible, I added the wordpress image to my docker-compose.yml,…