array( 'name' =>esc_html__( 'Portfolios' ), 'singular_name' =>esc_html__( 'Portfolio' ) ), 'public' => true, 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields', ), 'taxonomies' => array( 'categories' ), 'rewrite' => array('slug' => 'portfolios'), 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 50, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'page', ) ); } add_action( 'init', 'portfolioplugin_setup_post_type' ); add_action( 'init', 'create_portfolio_tax' ); function create_portfolio_tax() { register_taxonomy( 'portfoliocategories', 'portfolios', array( 'label' =>esc_html__( 'Portfolio Categories' ), 'rewrite' => array( 'slug' => 'portfoliocategories' ), 'hierarchical' => true, ) ); } /************************Start Services posttype***************/ function services_post_type() { // register the "book" custom post type register_post_type( 'Services', array( 'labels' => array( 'name' =>esc_html__( 'Services' ), 'singular_name' =>esc_html__( 'Service' ) ), 'public' => true, 'supports' => array( 'title', 'editor', 'excerpt', 'author', 'thumbnail', 'comments', 'revisions', 'custom-fields' ), 'taxonomies' => array( 'categories' ), 'rewrite' => array('slug' => 'services'), 'hierarchical' => true, 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'menu_position' => 50, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'page', ) ); } add_action( 'init', 'services_post_type' ); //services custom taxonomy add_action( 'init', 'create_services_tax' ); function create_services_tax() { register_taxonomy( 'servicecategories', 'services', array( 'label' =>esc_html__( 'Services Categories' ), 'rewrite' => array( 'slug' => 'servicecategories' ), 'hierarchical' => true, ) ); } /************************Start Services posttype***************/ /*******************Activation*****************/ function taskereasy_install() { // trigger our function that registers the custom post type portfolioplugin_setup_post_type(); //portfolio custom posttype create_portfolio_tax(); // portfolio_shortcode(); services_post_type(); //service custom posttype //testimonial_post_type(); //testimonial custom posttype // clear the permalinks after the post type has been registered flush_rewrite_rules(); } register_activation_hook( __FILE__, 'taskereasy_install' ); /**************Deactivation*****************/ function taskereasy_deactivation() { // unregister the post type, so the rules are no longer in memory unregister_post_type( 'book' ); // clear the permalinks to remove our post type's rules from the database flush_rewrite_rules(); } register_deactivation_hook( __FILE__, 'taskereasy_deactivation' ); /*------------------------------------------------------- * Visual Composer Shortcodes *-------------------------------------------------------*/ function taskereasy_load_vc_addons() { if (class_exists('WPBakeryVisualComposerAbstract')) { require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-heading.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-testimonials.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-single-image.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-services.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-faq.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-button.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-image-text.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-timeline.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-team.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-pricing.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-logo.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-tabs.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-logos.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-blog.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-icon-text.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-portfolios.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-counter.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-address.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-map.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-youtube.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-cta.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-services-blog.php'; require_once plugin_dir_path( __FILE__ ) . 'shortcode/vc-portfolios-post.php'; } } add_action( 'init','taskereasy_load_vc_addons');