WordPress Create Plugin From Scratch

0
()

Today, We want to share with you WordPress Create Plugin From Scratch.In this post we will show you A Complete Guide of Creating WordPress Plugin from Scratch, hear for WordPress Plugin Development from Scratch we will give you demo and example for implement.In this post, we will learn about Create a Custom WordPress Plugin From Scratch with an example.

Simple Create WordPress Create Plugin From Scratch

There are the Following The simple About Simple WordPress Create Plugin Step By Step Full Information With Example and source code.

As I will cover this Post with live Working example to develop How to Create a WordPress Plugin from Scratch – A Step by Step Guide, so the create wordpress plugin with database for this example is following below.

Read Also:  Laravel 5.7 Image File Validator Validation

WordPress Plugin Development – Step by Step Guide

Step 1 : Install Plugin

Path : htdocs/blog_name/wp-content/plugins/create_custom_post/create-custom-plugin.php

create-custom-plugin.php

<?php 
/*
Plugin Name: Pakainfo website
Plugin URI:  https://www.pakainfo.com/
Description: Basic WordPress Plugin Custom Inline Post Type
Version:     1.0
Author:      Jaydeep Gondaliya
Author URI:  https://www.pakainfo.com/
License:     pakainfo
License URI: https://www.pakainfo.com/
*/
 
function custom_inline_post_setup() {
    $params = array(
        'public'    => true,
        'label'     => __( 'Custom Post', 'textdomain' )
    );
    register_post_type( 'custom_post', $params );
}
add_action( 'init', 'custom_inline_post_setup' );
 
add_shortcode( 'inline-post-list', 'inline_post_list' );
function inline_post_list( $atts ) {
 ob_start();
 $params=array(
      'post_type' => 'custom_post', // Post Type Slug
      'posts_per_page' =>-1, // Display All
   'order'=> 'Desc'
    );
     $terms = new WP_Query($params);
    while ($terms->have_posts()) : $terms->the_post();
?>
 
<div class="single_post">
<div class="span6">
<div class="post_title">
<a href="<?php the_permalink();?>"><?php the_title(); ?></a>
</div>
</div>
<div class="span6">
<?php  the_content(); ?>
</div>
</div>
 
<?php
    endwhile;
 wp_reset_query(); 
 $myvariable = ob_get_clean();
 return $myvariable;
}
?>

Step 2 : Create any page – Like Post List

Path : Pages-> Add New -> Page Name : “Post List”

Read Also:  instamojo payment gateway integration in php

here Put Your shortcode to load the custom posts

[inline-post-list]

Web Programming Tutorials Example with Demo

Read :

Summary

You can also read about AngularJS, ASP.NET, VueJs, PHP.

Free Live Chat for Any Issue
Download

I hope you get an idea about Simple WordPress Create Plugin.
I would like to have feedback on my infinityknow.com blog.
Your valuable feedback, question, or comments about this article are always welcome.
If you enjoyed and liked this post, don’t forget to share.

Read Also:  How to Create a Wordpress Plugin in 10 Minutes Flat

How useful was this post?

Click on a star to rate it!