Here is a quick snippet of a PHP to store Contact Form 7 form submissions in TablePress tables. Make sure you update the form-to-table-ID mapping in $form_to_table_map array to match your setup: ...
Reading and processing button presses with microcontrollers is a lot harder than one could assume because of the signal noise for which we have hardware and software solutions. I couldn’t find ...
It took me a few days to read through the relevant parts of the webpack and webpack-dev-server source code and figure out how to enable Webpack Hot Module Replacement for any project that doesn...
YouTube provides these subscribe buttons which include the number of your channel subscribers which can be extracted using a simple regular expression. Extract the Subscribe Count in PHP The C...
Update: This script has been converted into a proper PHP library called MiniSheets that can be installed as a Composer dependency. All instructions below are for the original script. Excel .xlsx ...
Here is how to enforce SSL for WordPress admin only on certain sites on your Multisite network by adding this snippet to wp-config.php: $ssl_domains = array( 'example.com', 'anotherexample.com', ...
Blogs usually provide multiple feeds for things like posts, comments and categories so you want to pick the right one when subscribing to the site on Feedly. I created a little bookmarklet that d...
Everyone knows that GitHub is awesome and so is their API. However, there are limits to the amount of unauthenticated request you can make to the API from a single IP address. I am using their A...
https://kaspars.net/blog/use-nginx-reverse-proxy-mirror-github-api
Here is a quick way to get follower stats for any Twitter user without using the Twitter API. I found this via their Follow button so please don’t consider this a permanent solution. https://c...
WordPress will ignore your page template settings for the static front page with themes that include their own front-page.php. Here is a quick filter that checks for a page template setting and ...
I have updated the Minit plugin to include the following improvements: Purging cache will no longer delete files in the Minit cache folder. Instead, it will bump a global version number that is u...
https://kaspars.net/blog/minit-cache-purge-exclude-files-filter
Ever wanted to work on your GitHub Gists locally? Here is the SSH URL for Gists: git@gist.github.com:NNNNNN.git where NNNNNN is the ID of your Gist. Read more →
GitHub provides a really nice way of creating release zip files for any of your GitHub projects. Here is a very simple shell script that can be used with any non-GitHub repository for creating r...
Sometimes for a responsive website you might want to apply the desktop stylesheet also on tablets and mobile devices in landscape mode. When using media queries to style a website based on the de...
This is a guest post by Ronald Huereca (@ronalfy): By default, WordPress SEO will create XML sitemaps for custom post types with the public setting set to false. In my opinion, this is incorrect...
https://kaspars.net/blog/disable-sitemap-post-type-wordpress-seo
Here is a simple shell snippet to optimise a batch of PNG images in a folder recursively using PNGOUT → Read more →
Here are two simple filters to remove the rewrite of
https://kaspars.net/blog/disable-title-rewrite-wordpress-seo
Today I noticed that WordPress (3.6-alpha-23883) has started automatically adding content to my posts that use post format other than the standard “post” and have some of the new meta fields...
If you want to do MAX, MIN, AVG or other kind of mathematical operation on non-numeric MySQL columns (such as longtext for meta_value in WordPress), you can cast it to float like this: SELECT met...
Rel attributes are used by many gallery/slideshow scripts (thickbox, fancybox, colorbox) for grouping images into galleries. In my previous articles I explained how to add unique rel attributes...
https://kaspars.net/blog/add-rel-attribute-to-each-gallery-post
Ever wanted to use Dropbox for managing your static HTML site or blog? One option is to simply install the Dropbox Linux client and symlink the folder you want to the public folder server by Apac...
https://kaspars.net/blog/php-proxy-dropbox-host-static-website
Minit is a WordPress plugins that combines (concatenates) all CSS and Javascript files that are enqueued using proper wp_enqueue_script and wp_enqueue_style methods. It also detects external Java...
The default WordPress importer can’t transfer more images than the PHPexecution time allows it to, which makes it almost impossible to migrate a large WordPress.com site with lots of media ass...
https://kaspars.net/blog/download-migrate-attachments-images-from-large-wordpress-com-blog
Here is a quick and undocumented fix for placing postal code before city name in address fields generated by Gravity Forms plugin: add_filter( 'gform_address_display_format', 'place_zip_before_ci...
https://kaspars.net/blog/postal-zip-code-before-city-gravity-forms-address
I just wrote a tutorial on how to use Git (and GitHub) with Subversion mirroring for WordPress plugin development. Read more →
https://kaspars.net/blog/use-github-for-wordpress-plugin-development
WordPress doesn’t fully support adding plugins by using symbolic links in the wp-content/plugins folder. This is because plugins_url() which is often used for enqueuing plugin CSS and Javascrip...
Add Custom Image Sizes to Media Uploader — It’s been long since I wanted to write a tutorial on doing just that. Thanks Pippin! Read more →
https://kaspars.net/blog/add-custom-image-sizes-to-media-uploader
Update: This is useful only if you can’t edit your local /etc/hosts file (using a tool like Gas Mask makes it fast and super easy) and use the production domain for development. To my knowledge...
https://kaspars.net/blog/develop-wordpress-multisite-locally-using-production-database
Link: Create custom URLs (permalinks and permastructures) for custom post types which include all parent terms from a custom taxonomy. Such as http://example.com/recipes/breakfast,brunch/boiled-e...
https://kaspars.net/blog/include-taxonomy-terms-in-permalinks-custom-post-types
The new Facebook plugin for WordPress is really nice — well written and uses only the best practices in WordPress plugin development. Here a few tips to help you customize the functionality of ...
https://kaspars.net/blog/facebook-for-wordpress-manual-social-button-placement