How to Create Custom Post Types in WordPress

Open your functions.php file of your active child theme (or theme) and add the code below to it. Make sure the code is added before the closing PHP tag. I will explain the code below. add_action( ‘init’, ‘ls_register_post_types’ ); function ls_register_post_types() { register_post_type( ‘cst_new’, array( ‘labels’ => array( ‘name’ => ‘News’, ‘singular_name’ => ‘news’ ),

How to add color filter in woocommerce

step 1 : Open your functions.php file of your active child theme (or theme) and add the code below to it. Make sure the code is added before the closing PHP tag. // Register a custom taxonomy for color add_action(‘init’, ‘custom_taxonomy_color’); function custom_taxonomy_color() { $labels = array( ‘name’ => _x(‘Colors’, ‘taxonomy general name’, ‘textdomain’), ‘singular_name’

How to create a custom wordpress widget

I’m going to show you how to create custom widget in wordpress. Here is the code , Paste this code in your function.php file of your active child theme (or theme). // Register and load the widget add_action( ‘widgets_init’, ‘register_my_widget’ ); function register_my_widget() { register_widget( ‘My_Widget’ ); } // Creating the widget class My_Widget extends

Scroll to Top