Blog

WordPress + AJAX

Action wp_ajax Always Returning 0 One of the common reason why this can happen is when the user is not logged in. Try adding the ff: add_action(‘wp_ajax_nopriv_extract-files’, ‘extractFiles’); Also, when you’re using jsonP, you cannot use type POST

Read More
How to Use WP Cron

Scheduling an event in WordPress is very common. This functionality is commonly known as CRON. Here are the steps on how to can create CRON tasks. Step 1: Determine the desired recurrence There are three predefined recurrences defined by WordPress, namely: daily, twicedaily, & hourly. If you want to define your own recurrence, you can

Read More
How to Make PHP mail() Function Work in Localhost Server

There are several ways that could make PHP mail() function work in localhost. I haven’t tried them except for the solution below: Download sendmail and extract it on your desired location. Open sendmail.ini and enter the credentials needed: smtp_server=smtp.gmail.com smtp_port=465 auth_username=user@gmail.com auth_password=your_password Open php.ini and uncomment sendmail path and enter the path sendmail_path = “\”C:\sendmail\sendmail.exe\”

Read More
How to Create Custom WP Metabox

Default and custom types already have default fields that we can fill in, but what it we need custom data for these post types? In this kind of need, we can opt to create custom metaboxes which will contain custom fields for the desired post types. To make the implementation of a custom metabox easier,

Read More