%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/eirtvhdf/makkitrust.org/wp-content/themes/alhambra/
Upload File :
Create Path :
Current File : /home/eirtvhdf/makkitrust.org/wp-content/themes/alhambra/index-portfolio.php

<?php
/**
 * The template for homepage posts with "Portfolio" style
 *
 * @package WordPress
 * @subpackage ALHAMBRA
 * @since ALHAMBRA 1.0
 */

alhambra_storage_set('blog_archive', true);

// Load scripts for both 'Gallery' and 'Portfolio' layouts!
wp_enqueue_script( 'imagesloaded' );
wp_enqueue_script( 'masonry' );
wp_enqueue_script( 'classie', alhambra_get_file_url('js/theme.gallery/classie.min.js'), array(), null, true );
wp_enqueue_script( 'alhambra-gallery-script', alhambra_get_file_url('js/theme.gallery/theme.gallery.js'), array(), null, true );

get_header(); 

if (have_posts()) {

	echo get_query_var('blog_archive_start');

	$alhambra_stickies = is_home() ? get_option( 'sticky_posts' ) : false;
	$alhambra_sticky_out = alhambra_get_theme_option('sticky_style')=='columns' 
							&& is_array($alhambra_stickies) && count($alhambra_stickies) > 0 && get_query_var( 'paged' ) < 1;
	
	// Show filters
	$alhambra_cat = alhambra_get_theme_option('parent_cat');
	$alhambra_post_type = alhambra_get_theme_option('post_type');
	$alhambra_taxonomy = alhambra_get_post_type_taxonomy($alhambra_post_type);
	$alhambra_show_filters = alhambra_get_theme_option('show_filters');
	$alhambra_tabs = array();
	if (!alhambra_is_off($alhambra_show_filters)) {
		$alhambra_args = array(
			'type'			=> $alhambra_post_type,
			'child_of'		=> $alhambra_cat,
			'orderby'		=> 'name',
			'order'			=> 'ASC',
			'hide_empty'	=> 1,
			'hierarchical'	=> 0,
			'exclude'		=> '',
			'include'		=> '',
			'number'		=> '',
			'taxonomy'		=> $alhambra_taxonomy,
			'pad_counts'	=> false
		);
		$alhambra_portfolio_list = get_terms($alhambra_args);
		if (is_array($alhambra_portfolio_list) && count($alhambra_portfolio_list) > 0) {
			$alhambra_tabs[$alhambra_cat] = esc_html__('All', 'alhambra');
			foreach ($alhambra_portfolio_list as $alhambra_term) {
				if (isset($alhambra_term->term_id)) $alhambra_tabs[$alhambra_term->term_id] = $alhambra_term->name;
			}
		}
	}
	if (count($alhambra_tabs) > 0) {
		$alhambra_portfolio_filters_ajax = true;
		$alhambra_portfolio_filters_active = $alhambra_cat;
		$alhambra_portfolio_filters_id = 'portfolio_filters';
		if (!is_customize_preview())
			wp_enqueue_script('jquery-ui-tabs', false, array('jquery', 'jquery-ui-core'), null, true);
		?>
		<div class="portfolio_filters alhambra_tabs alhambra_tabs_ajax">
			<ul class="portfolio_titles alhambra_tabs_titles">
				<?php
				foreach ($alhambra_tabs as $alhambra_id=>$alhambra_title) {
					?><li><a href="<?php echo esc_url(alhambra_get_hash_link(sprintf('#%s_%s_content', $alhambra_portfolio_filters_id, $alhambra_id))); ?>" data-tab="<?php echo esc_attr($alhambra_id); ?>"><?php echo esc_html($alhambra_title); ?></a></li><?php
				}
				?>
			</ul>
			<?php
			$alhambra_ppp = alhambra_get_theme_option('posts_per_page');
			if (alhambra_is_inherit($alhambra_ppp)) $alhambra_ppp = '';
			foreach ($alhambra_tabs as $alhambra_id=>$alhambra_title) {
				$alhambra_portfolio_need_content = $alhambra_id==$alhambra_portfolio_filters_active || !$alhambra_portfolio_filters_ajax;
				?>
				<div id="<?php echo esc_attr(sprintf('%s_%s_content', $alhambra_portfolio_filters_id, $alhambra_id)); ?>"
					class="portfolio_content alhambra_tabs_content"
					data-blog-template="<?php echo esc_attr(alhambra_storage_get('blog_template')); ?>"
					data-blog-style="<?php echo esc_attr(alhambra_get_theme_option('blog_style')); ?>"
					data-posts-per-page="<?php echo esc_attr($alhambra_ppp); ?>"
					data-post-type="<?php echo esc_attr($alhambra_post_type); ?>"
					data-taxonomy="<?php echo esc_attr($alhambra_taxonomy); ?>"
					data-cat="<?php echo esc_attr($alhambra_id); ?>"
					data-parent-cat="<?php echo esc_attr($alhambra_cat); ?>"
					data-need-content="<?php echo (false===$alhambra_portfolio_need_content ? 'true' : 'false'); ?>"
				>
					<?php
					if ($alhambra_portfolio_need_content) 
						alhambra_show_portfolio_posts(array(
							'cat' => $alhambra_id,
							'parent_cat' => $alhambra_cat,
							'taxonomy' => $alhambra_taxonomy,
							'post_type' => $alhambra_post_type,
							'page' => 1,
							'sticky' => $alhambra_sticky_out
							)
						);
					?>
				</div>
				<?php
			}
			?>
		</div>
		<?php
	} else {
		alhambra_show_portfolio_posts(array(
			'cat' => $alhambra_cat,
			'parent_cat' => $alhambra_cat,
			'taxonomy' => $alhambra_taxonomy,
			'post_type' => $alhambra_post_type,
			'page' => 1,
			'sticky' => $alhambra_sticky_out
			)
		);
	}

	echo get_query_var('blog_archive_end');

} else {

	if ( is_search() )
		get_template_part( 'content', 'none-search' );
	else
		get_template_part( 'content', 'none-archive' );

}

get_footer();
?>

Zerion Mini Shell 1.0