• Hi,
    I need to include this plugin in my WordPress theme without plugin activation.

    In main plugin file, tiled-gallery.php, on lines 22-25 I have these lines:

    include_once dirname( __FILE__ ) . '/math/class-constrained-array-rounding.php';
    include( plugin_dir_path( __FILE__ ) . 'class.jetpack-user-agent.php');
    include( plugin_dir_path( __FILE__ ) . 'functions.gallery.php');
    include( plugin_dir_path( __FILE__ ) . 'jetpack-carousel.php');

    and on line 98:

    public function default_scripts_and_styles() {
      wp_enqueue_script( 'tiled-gallery', plugins_url( 'tiled-gallery/tiled-gallery.js', __FILE__ ), array( 'jquery' ) );
      wp_enqueue_style( 'tiled-gallery', plugins_url( 'tiled-gallery/tiled-gallery.css', __FILE__ ), array(), '2012-09-21' );
    }

    And in file functions.gallery.php on line 24:

    function wp_enqueue_media() {
      if ( ! wp_script_is( 'jetpack-gallery-settings', 'registered' ) )
    	 wp_register_script( 'jetpack-gallery-settings', plugins_url( 'gallery-settings.js', __FILE__ ), array( 'media-views' ), '20121225' );
      wp_enqueue_script( 'jetpack-gallery-settings' );
    }

    I think I need to use function get_template_directory_uri() instead of plugin_dir_path and plugins_url to include these files, but I’m confused.

    I’m new in WordPress. Can somebody suggest a solution to this problem? ??

  • The topic ‘How to include plugin in a theme?’ is closed to new replies.