Puddinq.com sharing knowledge

Add things to robots.txt

Add things to robots.txt

In WordPresss there is a hook to add stuff to the robots.txt searchengines use to determine what to search thrue. In the following example we add the sitemap to robots.txt to make sure searchengines will find it.

WordPress nonce why?, how and show me

WordPress nonce has been available for a while, but if you are just starting to use it here is why, how and a copy and past example. Why use nonce with WordPress? Lets say you have two pages in your admin, page one and page two. Page one is a settings screen but page two […]

Enqueue child style after parent style

There are a number of possibilities for adding the child theme styles after the parent style sheet so you can overrule parent styles from the child theme. this one is easy, copy the code to your functions.php and it will work.

Guest writer

Guest writer is a puddinq plugin that could suit your needs. The setup is simple: create a user role that can edit one post type. The options vary from allowing (un) registered people posting content that is automatically published or after a test of a moderator. Let people register frontend and create edit / posts […]

Debug WordPress live

If you want to know about errors on a production site your could set WP_DEBUG to true. But visitors will be able to see the errors and as a result trust in your site declines, to debug WordPress live it is best to log.

WPML switch backend language on language switch

Since wp 4.7 the backend language is changed by changing the language in your userprofile. Using WPML, if you change the site language or post-, page language, the backend language is not changing. The code below changes the site language when changing the wpml language selector.

Displaying responsive image in WordPress

Since WordPress 4.4, WordPress has its own way to display responsive images. The <img> tag can now hold a variety of sources that can be displayed based on the screen te page is viewed on. Displaying a thumbnail image

Add attachment to WooCommerce mail for certain products

Lets say you want an attachment.pdf added to an completed order mail in WooCommerce if certain products are in the order. How do you add and attachment in that case? With the following code you be able to select one of the mails send in the proces and add the attachment if one of the […]

Object orientated programming and namespaces in wordpress

Recently I did a 4 parts tutorial Tom McFarlin wrote on object orientated programming and namespaces in WordPress and it really shed some light on both subjects for me. The link. IT, webdesign … programming they all come with the aspect of learning. Like PHPStorm just had a mayor update, things change and you need […]