is_tax('portfolio-type') || $query->is_tax('portfolio-tag')):
global $ascend;
if(isset($ascend['portfolio_tax_items']) ) {
$portfolio_items = $ascend['portfolio_tax_items'];
} else {
$portfolio_items = '12';
}
$query->set('posts_per_page', $portfolio_items);
return;
endif;
}
add_action( 'kadence_portfolio_header', 'ascend_single_portfolio_header', 20 );
function ascend_single_portfolio_header() {
if(ascend_display_pagetitle()) {
get_template_part('templates/post', 'header');
} else {
if( ascend_display_portfolio_breadcrumbs()) {
echo '
';
ascend_breadcrumbs();
echo '
';
}
}
}
add_action( 'kadence_single_portfolio_content_after', 'ascend_wp_link_pages', 10 );
function ascend_portfolio_nav() {
global $post, $ascend;
if(isset($ascend['portfolio_single_nav']) && $ascend['portfolio_single_nav'] == 1) {
echo '';
}
}
add_action( 'kadence_single_portfolio_footer', 'ascend_portfolio_nav', 20 );
function ascend_portfolio_bottom_carousel() {
global $post, $ascend;
$portfolio_carousel = get_post_meta( $post->ID, '_kad_portfolio_carousel', true );
if (empty($portfolio_carousel) || $portfolio_carousel == 'default') {
if(isset($ascend['portfolio_bottom_carousel']) && $ascend['portfolio_bottom_carousel'] != 'none') {
get_template_part('templates/content', 'single-portfolio-bottom-carousel');
}
} else if($portfolio_carousel != 'none'){
get_template_part('templates/content', 'single-portfolio-bottom-carousel');
}
}
add_action( 'kadence_single_portfolio_after', 'ascend_portfolio_bottom_carousel', 30 );
function ascend_portfolio_comments() {
global $ascend;
if(isset($ascend['portfolio_comments']) && $ascend['portfolio_comments'] == 1) {
comments_template('/templates/comments.php');
}
}
add_action( 'kadence_single_portfolio_after', 'ascend_portfolio_comments', 40 );
add_filter( 'kadence_single_portfolio_image_height', 'ascend_portfolio_single_image_height', 10 );
function ascend_portfolio_single_image_height() {
global $ascend;
if(isset($ascend['portfolio_header_single_image_height']) && $ascend['portfolio_header_single_image_height'] == 1 ) {
return null;
} else {
return 450;
}
}
function ascend_portfolio_single_layout() {
global $post;
$layout = get_post_meta( $post->ID, '_kad_ppost_layout', true );
if(empty($layout) || $layout == 'default') {
if(isset($ascend['project_layout_default'])) {
$layout = $ascend['project_layout_default'];
} else {
$layout = 'beside';
}
}
return $layout;
}
function ascend_portfolio_slider_width() {
$layout = ascend_portfolio_single_layout();
$maxwidth = ascend_max_width();
if( $layout == 'above' || $layout == 'three'){
if($maxwidth == 'none') {
$width = 1800;
} else if($maxwidth == '940') {
$width = 940;
} else if($maxwidth == '1470') {
$width = 1440;
} else if($maxwidth == '1770') {
$width = 1740;
} else {
$width = 1140;
}
} else if( $layout == 'besidesmall') {
if($maxwidth == 'none') {
$width = 1400;
} else if($maxwidth == '940') {
$width = 620;
} else if($maxwidth == '1470') {
$width = 960;
} else if($maxwidth == '1770') {
$width = 1170;
} else {
$width = 780;
}
} else {
if($maxwidth == 'none') {
$width = 1400;
} else if($maxwidth == '940') {
$width = 520;
} else if($maxwidth == '1470') {
$width = 840;
} else if($maxwidth == '1770') {
$width = 1040;
} else {
$width = 660;
}
}
return $width;
}
function ascend_portfolio_single_project_output() {
get_template_part('templates/content', 'single-portfolio-project');
}
add_action( 'kadence_single_portfolio_project', 'ascend_portfolio_single_project_output', 20 );