Web & Software Developer

Code Snippets and Tutorials

Insert Google Adsense Native In-article ad on Regular WordPress Posts, and AMP ad on AMP pages

This is one code snippet to insert Google Adsense ads on all your WordPress posts, both regular and AMP. (This code works with the official AMP for WordPress plugin.) This one code snippet will automatically insert one Google Adsense ad after the first paragraph of every post. On regular posts, it will insert a “Native … Read more →

How To Use a Shortcode in WordPress 5.0 and higher, The New WordPress Editor (Gutenberg)

If you’re using WordPress 5.0 or higher with the new WordPress editor, also known as Gutenberg, and you will use shortcodes a little differently than before. Instead of just pasting or typing the shortcode, the new Gutenberg WordPress editor requires 5 steps. (Yes, this seems very backwards.) First, click on the “plus” icon to add … Read more →

Bash Shell Script To Create a Release on GitHub

This shell script will create a new Release on GitHub for your git repo. This script should be placed in the base of your local git repository. You must configure the first 3 variables: ACCESSTOKEN – Set this to your personal GitHub access token. You can create an access token in your GitHub account > … Read more →

Show WP Admin Notice With Pure JavaScript

This adds a dismissible admin notice to the WP admin with pure JavaScript. No jQuery or other dependencies. The admin notice will have a Dismiss icon just like the regular WP admin notices. When the icon is clicked, the message will go away. This admin notice will have a blue left border which is given … Read more →