Create a custom table plugin in WordPress

category:  WordPress

For WordPress, most of the time you can create the custom post type, custom taxonomy or custom category that fits your need. But sometimes you may need your own table structure to store your data. For example, you sync the data from the external system into WordPress. Today I gonna share with you how to create a simple custom table via the plugin. In this tutorial, we will do three steps below write a PHP function that creates a database … Read More

How to pass Javascript value to PHP in WordPress

category:  WordPress

Working on customization in WordPress sometimes we need to pass the PHP value to Javascript or Javascript value to PHP. Today I will share how to pass Javascript value to PHP in WordPress. Let says we have a criteria form in which the users can fetch the data by the criteria. The data will query from the database by PHP and display on the screen as it shows below. We actually take the sample from one of my posts here. … Read More

Search by Custom Fields without a plugin

category:  WordPress

Lately, my client requires me to add the ability to search by custom fields at the backend. Today I gonna share what I did. There are three filters we will use. posts_join posts_where posts_distinct Below what page will be implemented. You can add the code below into functions.php or your own plugin. $_GET[‘s’] is the search input on the edit page. The posts_distinct filter is needed to prevent duplicate data. Yeap! that’s it. If you are looking for adding the … Read More

How to Add Additional Custom Fields into WooCommerce Checkout Page

category:  WordPress

Woocommerce plugin is one of the most popular e-commerce plugins for WordPress. The core fields on the checkout page are very common. Most of the time, my clients ask for adding new fields and remove the core fields out of the checkout page. Today I gonna share how to add new custom fields and remove the core fields from the checkout page. Below is what we gonna do create a new custom plugin remove some core fields from the checkout … Read More

Add Embedded Videos to WordPress and Make Them Responsive

category:  WordPress, Web development

Recently, I got a request from my client to add the video into WordPress. Plus the video must be responsive. Today, I gonna share with you how to implement it. IFRAME & HTML For the iframe responsive, we need a <div> or any HTML tag that is a block style (display:block) wraps the iframe. Below, we add the <div> with video-container class which we will add the style later. STYLESHEET (CSS) Adding the style to our video-container. We set position … Read More

HTML1506: Unexpected token in IE

category:  WordPress, Javascript, jQuery, Web development

Yesterday, I received a support task from one of my clients. It was urgent because the users could not buy the product online. The issue occurred only in the IE browser(IE11 and IE edge). I checked the error message at the console and I found “HTML1506: Unexpected token“. I saw the same error back in 2015 when I worked with another client in the USA. This error is very common in IE. The cause The sample of JS code that … Read More

Filter Posts by Custom Taxonomy in Admin area in WordPress

category:  WordPress

Let’s say we have a custom post type called “hotels“. We create the custom field named “country” and “rating” and add both fields into the “hotels” post type. In the Hotels page at the admin area, it shows hotel title, country, rating, author and date columns as the screenshot below. There are two hooks that involve in this solution. One is ” restrict_manage_posts” and another one is “parse_query “. The restrict_manage_posts hook will add the dropdown filter at the admin … Read More

Localhost is not is the list of supported domains – reCaptcha issue

category:  Web development, WordPress

Google reCaptcha is a free service that protects your site from spam and abuse. It is easy to set and use on any website. If you are a web developer and you migrate the existing site to your localhost. When you are developing the website on localhost, on the form that you integrate the reCaptcha(V2 or V3) shows you, the error says “Localhost is not is the list of supported domains“. Well, there is a reason why and a solution … Read More

How to increase the maximum upload filesize in WordPress

category:  WordPress

Last year, I wrote, “How to increase the maximum file upload size in Multisite WordPress Network with WHM“. Today I gonna share how to increase the maximum file upload size in WordPress(Not Network site). The screenshot below shows where we will set today. What we are looking for three settings below memory_limit post_max_size upload_max_filesize From the frontend, you can add this PHP code into your PHP file. This file will print out all PHP settings for your site. Beware this information … Read More

Google SiteKit for WordPress

category:  WordPress

If you are working on online marketing or SEO, you should know the traffic tracking tools. One of the popular online tools is Google services such as Search Console, Analytics, AdSense and PageSpeed Insights. For WordPress, there are some good plugins to help you integrate Google product into your WordPress site. But those plugins don’t include all Google services. They offer only Google Analytics. But now you can add all Google services related to the website with SiteKit by Google. … Read More

1 2 3 4