/**
  * Register/queue frontend scripts.
  *
  * @access public
  * @return void
  */
 public static function load_scripts()
 {
     global $post;
     global $portfolio_page_id;
     $suffix = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
     wp_enqueue_script('jquery');
     do_action('a3_portfolio_before_include_scripts');
     // Register any scripts for later use, or used as dependencies
     wp_register_script('jquery-cookie', A3_PORTFOLIO_JS_URL . '/prettyphoto/prettyphoto.js', array('jquery'), '2.1.2', true);
     wp_register_script('jquery-mobile-a3-portfolio', A3_PORTFOLIO_JS_URL . '/sort.js', array('jquery'), '2.1.2', true);
     /* wp_register_script('jquery-cookie', A3_PORTFOLIO_JS_URL . '/jquery.cookie.js', array('jquery'), '1.4.1', true);
               wp_register_script('jquery-mobile-a3-portfolio', A3_PORTFOLIO_JS_URL . '/jquery.mobile.custom' . $suffix . '.js', array('jquery'), '1.4.4', true);
               wp_register_script('jquery-lazyloadxt', A3_PORTFOLIO_JS_URL . '/lazyloadxt/jquery.lazyloadxt' . $suffix . '.js', array('jquery'), '1.0.6', true);
               wp_register_script('jquery-lazyloadxt-bg', A3_PORTFOLIO_JS_URL . '/lazyloadxt/jquery.lazyloadxt.bg' . $suffix . '.js', array('jquery'), '1.0.6', true);
               wp_register_script('jquery-imagesloaded', A3_PORTFOLIO_JS_URL . '/imagesloaded.pkgd' . $suffix . '.js', array('jquery'), '3.1.8', true);
     
               wp_register_script('a3-portfolio-script', apply_filters('a3_portfolio_script_url', A3_PORTFOLIO_JS_URL . '/a3.portfolio' . $suffix . '.js'), array('jquery'), '1.0.0', true);
               wp_register_script('a3-portfolio-widgets-script', apply_filters('a3_portfolio_widgets_script_url', A3_PORTFOLIO_JS_URL . '/a3.portfolio.widget' . $suffix . '.js'), array('jquery'), '1.0.0', true);
               wp_register_script('a3-portfolio-single-script', apply_filters('a3_portfolio_single_script_url', A3_PORTFOLIO_JS_URL . '/a3.portfolio.single' . $suffix . '.js'), array('jquery'), '1.0.0', true);
              */
     // CSS Styles
     $enqueue_styles = self::get_styles();
     if ($enqueue_styles) {
         foreach ($enqueue_styles as $handle => $args) {
             wp_register_style($handle, $args['src'], $args['deps'], $args['version'], $args['media']);
         }
     }
     // RTL CSS Styles
     $enqueue_styles_rtl = self::get_styles_rtl();
     if ($enqueue_styles_rtl) {
         foreach ($enqueue_styles_rtl as $handle => $args) {
             wp_register_style($handle, $args['src'], $args['deps'], $args['version'], $args['media']);
         }
     }
     if (is_viewing_portfolio_taxonomy() || $portfolio_page_id == $post->ID || stristr($post->post_content, '[portfoliopage') !== false) {
         do_action('a3_portfolio_before_portfolio_enqueue_lib_scripts');
         wp_enqueue_script('jquery-cookie');
         wp_enqueue_script('jquery-mobile-a3-portfolio');
         wp_enqueue_script('jquery-lazyloadxt');
         wp_enqueue_script('jquery-lazyloadxt-bg');
         wp_enqueue_script('jquery-imagesloaded');
         do_action('a3_portfolio_after_portfolio_enqueue_lib_scripts');
         wp_enqueue_script('a3-portfolio-script');
         do_action('a3_portfolio_before_portfolio_enqueue_styles');
         wp_enqueue_style('a3-portfolio-general-css');
         wp_enqueue_style('a3-portfolio-layout-css');
         do_action('a3_portfolio_after_portfolio_enqueue_styles');
         if (is_rtl()) {
             do_action('a3_portfolio_before_portfolio_enqueue_styles_rtl');
             wp_enqueue_style('a3-portfolio-general-css-rtl');
             wp_enqueue_style('a3-portfolio-layout-css-rtl');
             do_action('a3_portfolio_after_portfolio_enqueue_styles_rtl');
         }
     }
     do_action('a3_portfolio_after_include_scripts');
 }
 public function portfolio_category_template($content = '')
 {
     global $wpdb, $wp_query, $portfolio_query, $portfolio_query_vars;
     $output = '';
     if (preg_match("/\\[portfoliopage\\]/", $content)) {
         global $more, $is_IE;
         $more = 0;
         remove_filter('the_content', 'wpautop');
         list($wp_query, $portfolio_query) = array($portfolio_query, $wp_query);
         // swap the wpsc_query object
         $display_type = '';
         $number_columns = a3_portfolio_get_col_per_row();
         ob_start();
         remove_action('a3rev_loop_after', 'responsi_pagination', 10, 0);
         if (isset($wp_query->query_vars['taxonomy']) && 'portfolio_cat' == $wp_query->query_vars['taxonomy']) {
             a3_portfolio_get_template('taxonomy-portfolio_cat.php', array('number_columns' => $number_columns));
         } elseif (isset($wp_query->query_vars['taxonomy']) && 'portfolio_tag' == $wp_query->query_vars['taxonomy']) {
             a3_portfolio_get_template('taxonomy-portfolio_tag.php', array('number_columns' => $number_columns));
         } else {
             a3_portfolio_get_template('archive-portfolio.php', array('number_columns' => $number_columns));
         }
         $is_single = false;
         $output .= ob_get_clean();
         list($wp_query, $portfolio_query) = array($portfolio_query, $wp_query);
         // swap the wpsc_query objects back
         if ($is_single == false) {
             $GLOBALS['post'] = $wp_query->post;
         }
         $wp_query->current_post = $wp_query->post_count;
         return preg_replace("/(<p>)*\\[portfoliopage\\](<\\/p>)*/", $output, $content);
     } elseif (is_archive() && is_viewing_portfolio_taxonomy()) {
         remove_filter('the_content', 'wpautop');
         return $this->portfolio_category_template('[portfoliopage]');
     } else {
         return $content;
     }
 }