Advertisement
Guest User

toolkit plugin

a guest
Mar 25th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.46 KB | None | 0 0
  1. <?php
  2. /*
  3. Plugin name: seo toolkit
  4. */
  5. // Exit if accessed directly
  6.  
  7. if ( ! defined('ABSPATH')){
  8.     exit;
  9. }
  10.  
  11. // Define
  12. define('SEO_ACC_URL', WP_PLUGIN_URL .'/'. plugin_basename( dirname( __FILE__ )) .'/' );
  13. define( 'SEO_ACC_PATH', plugin_dir_path( __FILE__ ) );
  14.  
  15. add_action('init', 'my_theme_custom_post');
  16. function my_theme_custom_post(){
  17.     register_post_type('testimonial',
  18.      array(
  19.         'labels' => array(
  20.         'name' => __('Testimonials'),
  21.         'singular_name' => __('Testimonial')
  22.         ),
  23.         'supports' => array(
  24.         'title', 'editor', 'thumbnail', 'page-attributes'),
  25.         'public' => false,
  26.         'show_ui' => true,
  27.      )
  28.     );
  29. }
  30.  
  31. //Print shortcodes in widgets
  32. add_filter('widget_text', 'do_shortcode');
  33.  
  34. // Loading VC addons
  35. require_once( SEO_ACC_PATH . 'vc-addons/vc-blocks-load.php');
  36.  
  37. // Theme shortcodes
  38. require_once( SEO_ACC_PATH . 'theme-shortcodes/slides-shortcode.php' );
  39.  
  40. // Shortcodes depended on Visual Composer
  41. include_once( ABSPATH . 'wp-admin/includes/plugin.php');
  42. if (is_plugin_active('js_composer/js_composer.php')){
  43.     require_once( SEO_ACC_PATH . 'theme-shortcodes/staff-shortcode.php' );
  44. }
  45.  
  46. // Registering stock toolkit files
  47. function seo_toolkit_files(){
  48. wp_enqueue_style('owl-carousel', plugin_dir_url( __FILE__ ) . 'assets/css/owl-carousel.css');
  49. wp_enqueue_script( 'owl-carousel', plugin_dir_url( __FILE__) . 'assets/js/owl-carousel.min.js', array('jquery'),'20120206', true);
  50. }
  51. add_action('wp_enqueue_scripts', 'seo_toolkit_files');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement