Blog

Tips, tricks, and other valuable WordPress and web technology knowledge to save you time and make you money!

Blog

Add Uploaded Files to Media Library WordPress

If you just uploaded a bunch of files to a WordPress site via FTP and don’t see those files in your WordPress media library, we know just what you want. You want to add the uploaded files to the media library in your WordPress dashboard! Adding uploaded files to your WordPress site’s Media Library involves…

Uncaught TypeError: Cannot read property ‘InlineLayout’ of undefined

This error, or any error mentioning cannot read property, typically gets thrown when you try to run a function or reference a property on an object that doesn’t exist. For example, I was using the Google Translate widget and ran the JavaScript code below: new google.translate.TranslateElement({pageLanguage: ‘en’, includedLanguages: ‘es,en’, layout: google.translate.TranslateElement.InlineLayout.SIMPLE, autoDisplay: false}, ‘dgt_google_translate_element’); The…

Add Comments to YAML File

In order to add comments to a YAML file, you simply have to use the # (hashtag symbol) at the start of the line. For example, below is an example of one commented line in a YAML file. # This is an example of one commented line in a YAML file How to Add Block…

Get first characters of a string in PHP

There are two primary ways to get the first characters of a string in PHP. For example, let’s say we have a description of an article but we want to trim it down to the first 30 characters to generate an excerpt. Option 1: substr To me, the easiest option is to use PHP’s substr…

Customize Style of Google Translate Widget

The following two resources proved to be very helpful in my quest to adjust the styling on the Google Translate Widget. I ended up using Resource 1 because it was closest to the style that my client wanted but the demo for Resource 2 makes it seem like it would be very easy to implement….

save_post_attachment not working

In short, save_post_attachment doesn’t work and, instead, you need to use edit_attachment. We ran into an issue when we built an input that would allow users to allow certain media files to be downloaded while prohibiting others. However, when we tried to hook into the save_post_custom_post_type action, by adding the WordPress function below, to update…

Difference between WordPress Options and WordPress Postmeta

What are WordPress options settings? These are global settings. You can access these options outside of the post loop and without the need for a post id. The important thing to note is that these can be overwritten by other plugins so make sure to name your options something that is unlikely to be overwritten…

WordPress Plugin Development for Beginners

First, it’s important to understand how WordPress plugins fit into the WordPress Content Management System. Plugins provide nearly infinite extensibility and allow you to add a countless number of features to your WordPress website. For example, we built a plugin called WPMerchant which allows you to collect payments on your WordPress site or turn it…

Create WordPress Shortcode

Now that you’ve created your plugin, let’s delve into the definition of a shortcode. A shortcode is an element that you add to a page or post that gets turned into something else by the plugin or theme that registered the shortcode. Here is an example shortcode: Card Details Email If you install and activate WPMerchant and you…

Create Custom Post Type for WordPress Plugin

What is a Custom Post Type? I like to think of a custom post type as an object specifically as a different version of the WordPress Post object. You get all of the benefits of the post object but can name the object something else to suit your particular purposes.  We created a custom post…

Want to use our API?

Sign up below and we'll let you know when it's available for you to start your own WordPress hosting company.