Register custom post & custom taxonomy in WordPress

Register custom post type add_action( 'init', 'my_theme_custom_post' ); function my_theme_custom_post() { register_post_type( 'cpt', array( 'labels' => array( 'name' => __( 'CPTs' ), 'singular_name' => __( 'CPT' ) ), 'supports' => array('title', 'editor',...

How to register shortcode in WordPress

Single shortcode function single_shortcode_name( $atts, $content = null ) { return ''.do_shortcode($content).''; } add_shortcode('single_shortcode', 'single_shortcode_name');   Shortcode with attributes function shortcode_with_attributes( $atts, $content = null ) {...

WP Plugin QuickStart Pack

//Plugin information /* Plugin Name: Your plugin Name Plugin URI: http://example.com/pluginsurl Description: Given your plugin description here. Author: Author Name Version: 1.0 Author URI: http://example.com/ */ //The latest jquery need to use every plugin function...

Automatically Replace Words With Affiliate Links

function auto_add_affiliate_links($text){ $replace_words = array( //text to search => text to replace 'amazon' => 'Amazon', 'ebay' => 'Ebay', 'buy at amazon' => 'buy at amazon' ); $text = str_replace(array_keys($replace_words), $replace_words, $text);...