shortname, false, basename( dirname( __FILE__ ) ) . '/languages' ); } function script_easy_gallery_front() { wp_enqueue_style('easy-gallery-styles', plugins_url( '/css/default.css', __FILE__ ), array(), '1'); wp_enqueue_script('jquery-cycle', plugins_url( '/js/jquery.cycle.all.min.js', __FILE__ ), array('jquery'), '1'); wp_enqueue_script('jquery-easing', plugins_url( '/js/jquery.easing.1.3.min.js', __FILE__ ), array('jquery'), '1'); } function print_gallery ($output) { global $post; $result = ''; //$size = 'thumb'; if ( $images = get_children(array( 'post_parent' => $post->ID, 'post_type' => 'attachment', 'numberposts' => -1, 'post_mime_type' => 'image', 'orderby' => 'menu_order', 'order' => 'ASC'))) { if (is_array($images) and count($images) > 0){ $result = << .easygallery-container:after { clear:both; } EOF; $result .= '
'; $result .= '' . __('Previous', $this->shortname) . ''; $result .= '' . __('Next', $this->shortname) . ''; $result .= '
'; $result .= $thumbs; } } return $result; } } if (class_exists('EasyGallery')){ $EasyGallery = new EasyGallery(); // plugin's javascript & css add_action( 'wp_enqueue_scripts', array($EasyGallery, 'script_easy_gallery_front') ); // override default shortcode [gallery] add_filter( 'post_gallery', array($EasyGallery, 'print_gallery'), 11 ); } ?>