Posts

How to Create CPT in WordPress ?

Register Custom Post In WordPress <?php     /**      * Registers the "testimonial" post type.      */     add_action ( 'init' , 'ch_testimonials_post_type_register' );     function ch_testimonials_post_type_register () {         $labels = array (             'name'               => __ ( 'Testimonials' ,                     'ch-cpt' ),             'singular_name'      => __ ( 'Testimonial' ,                     'ch-cpt' ),             'all_items'          => __ ( 'All Testimonials' ,                 'ch-cpt' ),             'add_new'            => _x ( 'Add New' , 'testimonial' ,           'ch-cpt' ),             'add_new_item'       => __ ( 'Add New Testimonial' ,             'ch-cpt' ),             'edit_item'          => __ ( 'Edit Testimonial' ,                 'ch-cpt' ),

Wordpress Plugin Standards:

Header Requirements /** * Plugin Name: Example Plugin * Plugin URI: https://example.com/plugins/the-basics/ * Description: Basic WordPress Plugin Header Comment * Version: 1.0.0 * Author: Chirag Prajapati * Author URI: https://chrgprajapati.blogspot.com * License: GPL2 * License URI: https://www.gnu.org/licenses/gpl-2.0.html * Text Domain: example * Domain Path: /languages */ Define Basic Constant value define( 'EX_VERSION', '1.0' ); define( 'EX_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); define( 'EX_PLUGIN_DIR', untrailingslashit( dirname( __FILE__ ) ) ); define( 'EX_PLUGIN_URL', untrailingslashit( plugins_url( '', __FILE__ ) ) ); define( 'EX_CONTENT_URL', content_url( )); Above five is basic but you can define the extra variable as you want. like, define( 'EX_LOG_DIR', WP_CONTENT_DIR.'/uploads/ex_logs/'); define( 'EX_LOG_file', EX_LOG_DIR.'/ex_log.txt'

How to Add a “Back To Top” Button to Any Blog (Blogger, WordPress)

Having a lot of content means a lot of scrolling. It helps to make things a little easier for your readers if you include an easy way to jump all the way back to the top of the page. Adding a Back To Top button can easily solve scrolling issues and is really simple to implement! I’ve included a really easy Back To Top button here for you that you can add to any website or blog. All you need to edit are the theme’s CSS file and the main HTML template file. Add a Back To Top button to your site: To get started, add this to the CSS section of your site. In Blogger, this would be under Template > Customize > Advanced > CSS. In WordPress this is your theme’s style.css file. .back-to-top {     display:none;     position: fixed;     bottom: 2em;     right: 0px;     text-decoration: none;     color: #000000;     background-color: rgba(235, 235, 235, 0.80);     font-size: 12px;     padding: 1em;     } .back-to-top:hover {         background-color: rgba(135, 135, 135, 0.50);     t