Puddinq.com sharing knowledge

Puddinq.com - blog

WooCommerce cross- and up sells bi-directional update

If your would like one added (and removed) cross (or up) sell product in WooCommerce to automatically ad the ‘current’ product as an up- or cross sell to the connected code. The following code will inspire you:

Get posts not older then 2 months

To adjust the WordPress query to only retrieve posts not older then 2 months use the following query:

Translating strings in WordPress Javascript files

To translate strings in wordpress javascript files you need 3 things: Your javascript file with translatable string A json file with the translations a php file that loads the javascript an connects the translation The javascript The javascript could look like this To translate the javascript Load it in php

php storm remove exmpty lines

^ asserts position at start of a line Non-capturing group (?:[\t ]*(?:\r?\n|\r)){1,} {1,} matches the previous token between one and unlimited times, as many times as possible, giving back as needed (greedy) Match a single character present in the list below [\t ] * matches the previous token between zero and unlimited times, as many […]

Use curl to get certificate expiration date

Bash article icon

If you want to get the expiration date for an ssl certificate on a website, you can run the following command: But if the website is not live (dns is not pointing that way), you can make a curl request as if some resolve combination ip-address / domain name is in your hostfile. (without putting […]

1 2 3 14