How to send AJAX request from WordPress theme

AJAX makes easier to perform operations without submitting the form like – fetch, insert, delete records from MySQL database, file uploading, etc.

Using AJAX in WordPress is a little different. Here, need to consider two things –

  • AJAX sent URL should be admin-ajax.php.
  • wp_ajax action hooks.

In this tutorial, I show how you can handle AJAX request in your WordPress theme.

How to send AJAX request from WordPress theme

Read more

How to Programmatically File upload from Custom Plugin in WordPress

It easier to implement file uploading programmatically on the custom WordPress plugin using wp_handle_upload() method.

After successfully upload this returns the file path which you can use to store in the MySQL database table or display on the page.

In this tutorial, I create a simple plugin to demonstrate file upload in WordPress.

How to Programmatically file upload from Custom Plugin in WordPress

Read more

How to create simple WordPress Plugin

In WordPress plugins is the PHP script that extends the functionality of the website. They can easily be downloaded and install from the WordPress Dashboard.

You can also create your own plugins and use it.

All plugins are managed in wp-content/plugins/ directory.

In this tutorial, I show how you can create a simple WordPress plugin.

How to create simple WordPress Plugin

Read more

How to Create custom Shortcode in WordPress

In WordPress, Shortcode is special tags which specified within the [] brackets and use on the page, post, and widget.

The code is replaced with some other content when previewing the page.

It can also take parameters.

Shortcode is flexible and allows you to place it wherever you want.

In this tutorial, I will show how you can simply create Shortcode with or without parameters and use in WordPress.

In the example, I am creating Shortcodes in the WordPress theme.

How to Create custom Shortcode in WordPress

Read more