| Linux webm007.cluster106.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 Path : /home/eglisebaa/www/wp-content/themes/hallelujah/ |
| Current File : /home/eglisebaa/www/wp-content/themes/hallelujah/index-portfolio.php |
<?php
/**
* The template for homepage posts with "Portfolio" style
*
* @package WordPress
* @subpackage HALLELUJAH
* @since HALLELUJAH 1.0
*/
hallelujah_storage_set( 'blog_archive', true );
get_header();
if ( have_posts() ) {
hallelujah_blog_archive_start();
$hallelujah_stickies = is_home() ? get_option( 'sticky_posts' ) : false;
$hallelujah_sticky_out = hallelujah_get_theme_option( 'sticky_style' ) == 'columns'
&& is_array( $hallelujah_stickies ) && count( $hallelujah_stickies ) > 0 && get_query_var( 'paged' ) < 1;
// Show filters
$hallelujah_cat = hallelujah_get_theme_option( 'parent_cat' );
$hallelujah_post_type = hallelujah_get_theme_option( 'post_type' );
$hallelujah_taxonomy = hallelujah_get_post_type_taxonomy( $hallelujah_post_type );
$hallelujah_show_filters = hallelujah_get_theme_option( 'show_filters' );
$hallelujah_tabs = array();
if ( ! hallelujah_is_off( $hallelujah_show_filters ) ) {
$hallelujah_args = array(
'type' => $hallelujah_post_type,
'child_of' => $hallelujah_cat,
'orderby' => 'name',
'order' => 'ASC',
'hide_empty' => 1,
'hierarchical' => 0,
'taxonomy' => $hallelujah_taxonomy,
'pad_counts' => false,
);
$hallelujah_portfolio_list = get_terms( $hallelujah_args );
if ( is_array( $hallelujah_portfolio_list ) && count( $hallelujah_portfolio_list ) > 0 ) {
$hallelujah_tabs[ $hallelujah_cat ] = esc_html__( 'All', 'hallelujah' );
foreach ( $hallelujah_portfolio_list as $hallelujah_term ) {
if ( isset( $hallelujah_term->term_id ) ) {
$hallelujah_tabs[ $hallelujah_term->term_id ] = $hallelujah_term->name;
}
}
}
}
if ( count( $hallelujah_tabs ) > 0 ) {
$hallelujah_portfolio_filters_ajax = true;
$hallelujah_portfolio_filters_active = $hallelujah_cat;
$hallelujah_portfolio_filters_id = 'portfolio_filters';
?>
<div class="portfolio_filters hallelujah_tabs hallelujah_tabs_ajax">
<ul class="portfolio_titles hallelujah_tabs_titles">
<?php
foreach ( $hallelujah_tabs as $hallelujah_id => $hallelujah_title ) {
?>
<li><a href="<?php echo esc_url( hallelujah_get_hash_link( sprintf( '#%s_%s_content', $hallelujah_portfolio_filters_id, $hallelujah_id ) ) ); ?>" data-tab="<?php echo esc_attr( $hallelujah_id ); ?>"><?php echo esc_html( $hallelujah_title ); ?></a></li>
<?php
}
?>
</ul>
<?php
$hallelujah_ppp = hallelujah_get_theme_option( 'posts_per_page' );
if ( hallelujah_is_inherit( $hallelujah_ppp ) ) {
$hallelujah_ppp = '';
}
foreach ( $hallelujah_tabs as $hallelujah_id => $hallelujah_title ) {
$hallelujah_portfolio_need_content = $hallelujah_id == $hallelujah_portfolio_filters_active || ! $hallelujah_portfolio_filters_ajax;
?>
<div id="<?php echo esc_attr( sprintf( '%s_%s_content', $hallelujah_portfolio_filters_id, $hallelujah_id ) ); ?>"
class="portfolio_content hallelujah_tabs_content"
data-blog-template="<?php echo esc_attr( hallelujah_storage_get( 'blog_template' ) ); ?>"
data-blog-style="<?php echo esc_attr( hallelujah_get_theme_option( 'blog_style' ) ); ?>"
data-posts-per-page="<?php echo esc_attr( $hallelujah_ppp ); ?>"
data-post-type="<?php echo esc_attr( $hallelujah_post_type ); ?>"
data-taxonomy="<?php echo esc_attr( $hallelujah_taxonomy ); ?>"
data-cat="<?php echo esc_attr( $hallelujah_id ); ?>"
data-parent-cat="<?php echo esc_attr( $hallelujah_cat ); ?>"
data-need-content="<?php echo ( false === $hallelujah_portfolio_need_content ? 'true' : 'false' ); ?>"
>
<?php
if ( $hallelujah_portfolio_need_content ) {
hallelujah_show_portfolio_posts(
array(
'cat' => $hallelujah_id,
'parent_cat' => $hallelujah_cat,
'taxonomy' => $hallelujah_taxonomy,
'post_type' => $hallelujah_post_type,
'page' => 1,
'sticky' => $hallelujah_sticky_out,
)
);
}
?>
</div>
<?php
}
?>
</div>
<?php
} else {
hallelujah_show_portfolio_posts(
array(
'cat' => $hallelujah_cat,
'parent_cat' => $hallelujah_cat,
'taxonomy' => $hallelujah_taxonomy,
'post_type' => $hallelujah_post_type,
'page' => 1,
'sticky' => $hallelujah_sticky_out,
)
);
}
hallelujah_blog_archive_end();
} else {
if ( is_search() ) {
get_template_part( apply_filters( 'hallelujah_filter_get_template_part', 'content', 'none-search' ), 'none-search' );
} else {
get_template_part( apply_filters( 'hallelujah_filter_get_template_part', 'content', 'none-archive' ), 'none-archive' );
}
}
get_footer();