Puddinq.com sharing knowledge
';

Puddinq.com - blog

Remove /feed/ from url

Somehow your site git indexed with the feed url’s and even worse when the url does not excists in google anymore, google gives you two errors. One for the url and one for the same link with /feed/ behind it. To solve this you can use two actions. One: remove the feed from wh-head This […]

How can you allow editors to clear (manage) the WP Rocket cache

First of, you should look at the official documentation customize-access WP Rocket. This article uses the same technique but adds a trick. When you use the init hook, the function runs every time the hook fires. To reduce this, we have added an option and before we run the full function we check if that […]

Creating an npm package

I have enjoyed the easiness of npm packages a lot, they give you quick tools to do what they are specified for. I was so enthusiastic I wanted to make my own. Knowing it would be a lifetime study I am creating this post to document the basics and eventually more specific want to haves.

WooCommerce add attribute to multiple products (programmatically)

This snippets was used in winkel-centrum.nl, I needed to adjust an import and add colors found in the title as attributes. I had imported the products and wanted to extract a word from the title to add as attribute in the product. I used a shortcode because I wanted to visualize the products I was […]

Hide userprofile fields like facebook url - in edit profile

When you give access to the backend for minimal users, you will want te reduce the available options to make it more easy. One thing is the edit user profile where there are a lot of unused options. By adding (or removing) classes in the list you can hide the fields. Find the class associated […]

WooCommerce Checkout require number if not 'local pickup'

In the Netherlands WooCommerce removed the second address line. This made the error rate for people failing to insert the housenumber rise. I had two options, put the second line back and make it rweuired, or check if the one line that is there has a number in it..

Wp gravity forms and menu access for editor role

It is preferable to give ( even paying clients ) and editor role instead of an administrator role. This way you can be in control over theme settings and plugin installations / updates. But there are some things you can a allow your editor to control that do not fit in the role capabilities. Two […]

Insert extra link in yoast breadcrumb

There are a few filters in WordPress to give you the oppertunity to change an aspect, but the variable is an array the has a cetrain order. Yoast breadcrums is a filter like that. If you want to add an extra link to the main blog at the second position it is not as simple […]

PHP use a function in HereDoc

Heredocs are amazing ( under the right circumstances ), using ling strings with variables without endless echo’s or quotes and line endings. But using functions is a bit less convenient. I found the following made it work for me. (example uses the wordpress translation function)

There has been a critical error on your website. - WordPress

This option started in 2019. A friendly notice something is terribly wrong with the website. You might not feel it is friendly, and terribly might be an exaggeration. But anyway you are stuck.. if you are a normal user, like an editor you should contact the person maintaining the website. If you are the owner […]