With the help of ACF you can create custom fields for specific use cases of any registered post type in your site. After that you can insert data from the edit screen of a single post and update. If you are using a checkbox for any of your custom fields then you have to define… Continue reading How to use option panel data for a custom field with ACF
Category: Dev
Create a WordPress option page with ACF
When you are developing a theme or plugin, you might need to have an option page for your theme or plugin settings. Its is very easy to have that page with the help of ACF ( Advance Custom Field ) plugin. You also need to have pro version of this plugin to working properly. Let’s… Continue reading Create a WordPress option page with ACF
How to localize a script in WordPress
Before we localize a script, we need to register a script first. Because without this, we can not localize any script. Because to localize a script, we need a registered script handle. Here is the syntax to register a script. wp_enqueue_script( $handle:string, $src:string, $deps:array, $ver:string|boolean|null, $in_footer:boolean ) wp_enqueue_script( ‘myjs’, ‘path_to_js_file’, array( ‘jquery’ ), ‘1.0’, true… Continue reading How to localize a script in WordPress
WordPress Trips and Tricks – Part 1
How to show archive title instead of first post of custom post type When you create a template of your custom post type for the archive data, you might need to display archive title. But by default first post title comes up. To solve this type of problem WordPress has a function named post_type_archive_title() .… Continue reading WordPress Trips and Tricks – Part 1
How to change custom post type slug without loosing data
Sometime it happens, that at first we create custom post type, register taxonomy and insert some data for that custom post type. After moving forward, then we realise that, we need to change the slug for that custom post type. There might be some reason for this. Whatever the reason is, when we change the… Continue reading How to change custom post type slug without loosing data
WordPress Query Basics
Show all posts from a custom post type WordPress has a small function get_posts() to do this job. You just need to set your arguments and pass that argument inside the function. It returns an array of latest posts. You can use foreach function to loop though the returned array. Show all posts for a… Continue reading WordPress Query Basics
Query to show related post
We developer survive each and everyday and always spent a lot of time in google to find a simple solution for our day to day problem. Show related post in a single post is one of them. Today I also spent more than one hour in google to find this solution for a custom post… Continue reading Query to show related post
WP CLI : Error establishing a database connection in LocalWP
If you are using localwp for your local WordPress development then you might be face this database error issue at first time in WP CLI connection. Same things happen to me. Thats why I am helping you out. Here is the simple solution. You need to replace your DB_HOST from your wp-config.php file like below.… Continue reading WP CLI : Error establishing a database connection in LocalWP
How to work with multiple github account
You have a personal github account and recently join in a new company. Now you need to maintain your official github account. But you want to use two account at the same time from your computer. In this article I will show you how you get this job done. You have your personal SSH key… Continue reading How to work with multiple github account
Solve mysql is not recognized as an internal or external command
In command terminal of windows 10, mysql command is not rea By default windows 10 command terminal does not recognize mysql command. You need to add your server mysql path in you environment variable. Go to you server mysql path like mine. Add the above path in you environment variable. If you don’t know how… Continue reading Solve mysql is not recognized as an internal or external command