%s does not exist.', $template_file_path ), '1.0.0' ); return; } // Allow 3rd party plugin filter template file from their plugin $template_file_path = apply_filters( 'a3_portfolio_get_template', $template_file_path, $template_name, $args ); do_action( 'a3_portfolio_before_template_part', $template_name, $template_file_path, $args ); include( $template_file_path ); do_action( 'a3_portfolio_after_template_part', $template_name, $template_file_path, $args ); } /** * a3_portfolio_get_template_file_path( $file ) * * This is the load order: * * yourtheme / portfolio / $file * yourtheme / $file * A3_PORTFOLIO_TEMPLATE_PATH / $file * * @access public * @param $file string filename * @return PATH to the file */ function a3_portfolio_get_template_file_path( $file = '' ) { // If we're not looking for a file, do not proceed if ( empty( $file ) ) return; // Look for file in stylesheet if ( file_exists( get_stylesheet_directory() . '/portfolios/' . $file ) ) { $file_path = get_stylesheet_directory() . '/portfolios/' . $file; // Look for file in stylesheet } elseif ( file_exists( get_stylesheet_directory() . '/' . $file ) ) { $file_path = get_stylesheet_directory() . '/' . $file; // Look for file in template } elseif ( file_exists( get_template_directory() . '/portfolios/' . $file ) ) { $file_path = get_template_directory() . '/portfolios/' . $file; // Look for file in template } elseif ( file_exists( get_template_directory() . '/' . $file ) ) { $file_path = get_template_directory() . '/' . $file; // Get default template } else { $file_path = A3_PORTFOLIO_TEMPLATE_PATH . '/' . $file; } // Return filtered result return apply_filters( 'a3_portfolio_get_template_file_path', $file_path, $file ); } /** * a3_portfolio_get_per_page() * * @return number */ function a3_portfolio_get_per_page() { $post_per_page = 1000000; return apply_filters( 'a3_portfolio_get_per_page', $post_per_page ); } /** * a3_portfolio_get_col_per_row() * * @return number */ function a3_portfolio_get_col_per_row() { global $a3_portfolio_item_cards_settings; $number_columns = 3; if ( $a3_portfolio_item_cards_settings['portfolio_items_per_row'] >= 1 ) { $number_columns = $a3_portfolio_item_cards_settings['portfolio_items_per_row']; } return apply_filters( 'a3_portfolio_get_col_per_row', $number_columns ); } /** * a3_portfolio_get_col_per_row() * * @return number */ function a3_portfolio_card_image_height_fixed() { global $a3_portfolio_item_cards_settings; $portfolio_card_image_height_fixed = 60; if ( isset( $a3_portfolio_item_cards_settings['portfolio_card_image_height'] ) && $a3_portfolio_item_cards_settings['portfolio_card_image_height'] != 'fixed' ) { $portfolio_card_image_height_fixed = false; } elseif ( isset( $a3_portfolio_item_cards_settings['portfolio_card_image_height_fixed'] ) && $a3_portfolio_item_cards_settings['portfolio_card_image_height_fixed'] >= 50 ) { $portfolio_card_image_height_fixed = (int) $a3_portfolio_item_cards_settings['portfolio_card_image_height_fixed']; } return apply_filters( 'a3_portfolio_card_image_height_fixed', $portfolio_card_image_height_fixed ); } /** * a3_portfolio_get_desktop_expander_top_alignment() * * @return number */ function a3_portfolio_get_desktop_expander_top_alignment() { global $a3_portfolio_global_item_expander_settings; $top_alignment = 0; if ( (int) $a3_portfolio_global_item_expander_settings['desktop_top_alignment'] != 0 ) { $top_alignment = (int) $a3_portfolio_global_item_expander_settings['desktop_top_alignment']; } return apply_filters( 'a3_portfolio_get_desktop_expander_top_alignment', $top_alignment ); } /** * a3_portfolio_get_mobile_expander_top_alignment() * * @return number */ function a3_portfolio_get_mobile_expander_top_alignment() { global $a3_portfolio_global_item_expander_settings; $top_alignment = 0; if ( $a3_portfolio_global_item_expander_settings['enable_mobile_top_alignment'] && (int) $a3_portfolio_global_item_expander_settings['mobile_top_alignment'] != 0 ) { $top_alignment = (int) $a3_portfolio_global_item_expander_settings['mobile_top_alignment']; } return apply_filters( 'a3_portfolio_get_mobile_expander_top_alignment', $top_alignment ); } /** * is_viewing_portfolio_taxonomy() * * @return boolean */ function is_viewing_portfolio_taxonomy(){ global $wp_query; $wp_query->posts_per_page = 1; $is_viewing = false; if ( ( isset( $wp_query->query_vars['taxonomy'] ) && 'portfolio_cat' == $wp_query->query_vars['taxonomy'] ) || isset( $wp_query->query_vars['portfolio_cat'] ) || isset( $wp_query->query_vars['portfolio_tag'] ) ) { $is_viewing = true; } return apply_filters( 'is_viewing_portfolio_taxonomy', $is_viewing ); } /** * a3_portfolio_expander_template() * * @return html ouput */ function a3_portfolio_expander_template() { $expander_template = '
'; return $expander_template = apply_filters( 'a3_portfolio_expander_template', $expander_template ); } /** * a3_portfolio_header_meta() * * @return html ouput */ function a3_portfolio_header_meta() { echo ''; } /** * a3_portfolio_term_description() * * @return html ouput */ function a3_portfolio_term_description() { global $wp_query; $term_desc = ''; if ( isset( $wp_query->query_vars['portfolio_cat'] ) || isset($wp_query->query_vars['portfolio_tag'] ) ) { if ( isset( $wp_query->query_vars['portfolio_cat'] ) ) { if ( term_description() ) { $term_desc = ''.$category->description.'
';
}
$main_large_image = apply_filters( 'a3_portfolio_get_first_large_image', $main_large_image );
if ( $echo ) {
echo $main_large_image;
} else {
return $main_large_image;
}
}
/**
* a3_portfolio_get_entry_metas()
*
* @return void
*/
function a3_portfolio_get_entry_metas( $portfolio_id = 0 ) {
if ( $portfolio_id < 1 ) {
$portfolio_id = get_the_ID();
}
a3_portfolio_get_template( 'expander/entry-metas.php', array( 'portfolio_id' => $portfolio_id ) );
}
/**
* a3_portfolio_get_social_icons()
*
* @return void
*/
function a3_portfolio_get_social_icons( $portfolio_id = 0 ) {
global $a3_portfolio_global_item_expander_settings;
if ( ! $a3_portfolio_global_item_expander_settings['enable_expander_social'] ) return;
if ( $portfolio_id < 1 ) {
$portfolio_id = get_the_ID();
}
a3_portfolio_get_template( 'expander/social-icons.php', array( 'portfolio_id' => $portfolio_id ) );
}
/**
* a3_portfolio_get_gallery_thumbs()
*
* @return void
*/
function a3_portfolio_get_gallery_thumbs( $portfolio_id = 0, $gallery, $include_lightbox_script = false ) {
if ( $portfolio_id < 1 ) {
$portfolio_id = get_the_ID();
}
global $a3_portfolio_global_settings;
if ( $include_lightbox_script && 'yes' != $a3_portfolio_global_settings['item_post_gallery_lightbox'] ) {
$include_lightbox_script = false;
}
$image_blank = a3_portfolio_get_image_blank();
a3_portfolio_get_template( 'expander/gallery-thumbs.php', array( 'portfolio_id' => $portfolio_id, 'gallery' => $gallery, 'image_blank' => $image_blank, 'include_lightbox_script' => $include_lightbox_script ) );
}
/**
* a3_portfolio_get_thumbs_below_gallery()
*
* @return void
*/
function a3_portfolio_get_thumbs_below_gallery( $portfolio_id = 0 ) {
global $a3_portfolio_global_item_expander_settings;
if ( 'below_gallery' != $a3_portfolio_global_item_expander_settings['expander_thumb_gallery_position'] ) return;
global $portfolio_gallery;
a3_portfolio_get_gallery_thumbs( $portfolio_id, $portfolio_gallery );
}
/**
* a3_portfolio_get_thumbs_below_gallery()
*
* @return void
*/
function a3_portfolio_get_thumbs_right_gallery( $portfolio_id = 0 ) {
global $a3_portfolio_global_item_expander_settings;
if ( 'below_gallery' == $a3_portfolio_global_item_expander_settings['expander_thumb_gallery_position'] ) return;
global $portfolio_gallery;
a3_portfolio_get_gallery_thumbs( $portfolio_id, $portfolio_gallery );
}
/**
* a3_portfolio_get_categories_meta()
*
* @return void
*/
function a3_portfolio_get_categories_meta( $portfolio_id = 0 ) {
if ( $portfolio_id < 1 ) {
$portfolio_id = get_the_ID();
}
$portfolio_terms = get_the_terms( $portfolio_id, 'portfolio_cat' );
a3_portfolio_get_template( 'expander/categories-meta.php', array( 'portfolio_categories' => $portfolio_terms ) );
}
function a3_portfolio_main_get_categories_meta() {
global $a3_portfolio_global_item_expander_settings;
if ( ! $a3_portfolio_global_item_expander_settings['enable_expander_meta_cats'] ) return;
a3_portfolio_get_categories_meta();
}
function a3_portfolio_single_get_categories_meta() {
a3_portfolio_get_categories_meta();
}
/**
* a3_portfolio_get_tags_meta()
*
* @return void
*/
function a3_portfolio_get_tags_meta( $portfolio_id = 0 ) {
if ( $portfolio_id < 1 ) {
$portfolio_id = get_the_ID();
}
$portfolio_tags = get_the_terms( $portfolio_id, 'portfolio_tag' );
a3_portfolio_get_template( 'expander/tags-meta.php', array( 'portfolio_tags' => $portfolio_tags ) );
}
function a3_portfolio_main_get_tags_meta() {
global $a3_portfolio_global_item_expander_settings;
if ( ! $a3_portfolio_global_item_expander_settings['enable_expander_meta_tags'] ) return;
a3_portfolio_get_tags_meta();
}
function a3_portfolio_single_get_tags_meta() {
a3_portfolio_get_tags_meta();
}
/**
* a3_portfolio_get_attribute_table()
*
* @return void
*/
function a3_portfolio_get_attribute_table( $portfolio_id = 0, $is_single = false ) {
if ( $portfolio_id < 1 ) {
$portfolio_id = get_the_ID();
}
$attributes_value = a3_portofolio_get_portfolio_attributes_value( $portfolio_id );
$processed_attributes_value = array();
if ( is_array( $attributes_value ) && count( $attributes_value ) > 0 ) {
foreach ( $attributes_value as $attribute_id => $attribute ) {
// Don't get if it's for single and don't set visible on single from current portfolio
if ( $is_single && isset( $attribute['is_visible_post'] ) && 0 == $attribute['is_visible_post'] ) {
continue;
}
// Don't get if it's for expander and don't set visible on expander from current portfolio
if ( ! $is_single && isset( $attribute['is_visible_expander'] ) && 0 == $attribute['is_visible_expander'] ) {
continue;
}
$processed_attributes_value[$attribute_id] = $attribute;
}
}
a3_portfolio_get_template( 'global/attribute-table.php', array( 'portfolio_id' => $portfolio_id, 'attributes_value' => $processed_attributes_value ) );
}
/**
* a3_portfolio_get_expander_attribute_table_before()
*
* @return void
*/
function a3_portfolio_get_expander_attribute_above_desc( $portfolio_id = 0 ) {
global $a3_portfolio_global_item_expander_settings;
if ( 'above_description' != $a3_portfolio_global_item_expander_settings['expander_attribute_position'] ) return;
a3_portfolio_get_attribute_table( $portfolio_id, false );
}
/**
* a3_portfolio_get_expander_attribute_table_after()
*
* @return void
*/
function a3_portfolio_get_expander_attribute_bottom_content( $portfolio_id = 0 ) {
global $a3_portfolio_global_item_expander_settings;
if ( 'bottom_content' != $a3_portfolio_global_item_expander_settings['expander_attribute_position'] ) return;
a3_portfolio_get_attribute_table( $portfolio_id, false );
}
/**
* a3_portfolio_get_expander_attribute_table_after()
*
* @return void
*/
function a3_portfolio_single_get_attribute_under_gallery( $portfolio_id = 0 ) {
global $a3_portfolio_item_posts_settings;
if ( 'under_gallery' != $a3_portfolio_item_posts_settings['single_attribute_position'] ) return;
a3_portfolio_get_attribute_table( $portfolio_id, true );
}
/**
* a3_portfolio_get_expander_attribute_table_after()
*
* @return void
*/
function a3_portfolio_single_get_attribute_above_desc( $portfolio_id = 0 ) {
global $a3_portfolio_item_posts_settings;
if ( 'above_description' != $a3_portfolio_item_posts_settings['single_attribute_position'] ) return;
a3_portfolio_get_attribute_table( $portfolio_id, true );
}
/**
* a3_portfolio_get_expander_attribute_table_after()
*
* @return void
*/
function a3_portfolio_single_get_attribute_bottom_content( $portfolio_id = 0 ) {
global $a3_portfolio_item_posts_settings;
if ( 'bottom_content' != $a3_portfolio_item_posts_settings['single_attribute_position'] ) return;
a3_portfolio_get_attribute_table( $portfolio_id, true );
}
/**
* a3_portfolio_get_launch_button()
*
* @return void
*/
function a3_portfolio_get_launch_button( $portfolio_id = 0 ) {
if ( $portfolio_id < 1 ) {
$portfolio_id = get_the_ID();
}
$button_class = 'portfolio_button';
$button_text = get_post_meta( $portfolio_id, '_a3_portfolio_launch_button_text', true );
$button_link = get_post_meta( $portfolio_id, '_a3_portfolio_launch_site_url', true );
$open_type = get_post_meta( $portfolio_id, '_a3_portfolio_launch_open_type', true );
if ( empty( $button_text ) || $button_text == '' ) {
$button_text = a3_portfolio_ei_ict_t__( 'Launch Site Button Text', __( 'LAUNCH SITE', 'a3-portfolio' ) );
}
$button_class = apply_filters( 'a3_portfolio_launch_button_class', $button_class, $portfolio_id );
$button_text = apply_filters( 'a3_portfolio_launch_button_text', $button_text, $portfolio_id );
$button_link = apply_filters( 'a3_portfolio_launch_site_url', $button_link, $portfolio_id );
$open_type = apply_filters( 'a3_portfolio_launch_open_type', $open_type, $portfolio_id );
a3_portfolio_get_template( 'expander/launch-button.php', array( 'launch_site_url' => $button_link, 'button_text' => $button_text, 'open_type' => $open_type, 'button_class' => $button_class ) );
}
function a3_portfolio_main_get_launch_button() {
a3_portfolio_get_launch_button();
}
function a3_portfolio_single_get_launch_button() {
a3_portfolio_get_launch_button();
}
/**
* a3_portfolio_single_get_layout_column()
*
* @return layout_column
*/
function a3_portfolio_single_get_layout_column( $portfolio_id = 0 ) {
global $a3_portfolio_item_posts_settings;
if ( $portfolio_id < 1 ) {
$portfolio_id = get_the_ID();
}
// Get column for single portfolio page
$layout_column = get_post_meta( $portfolio_id, '_a3_portfolio_meta_layout_column', true );
if ( empty( $layout_column ) || $layout_column == '' ) {
$layout_column = $a3_portfolio_item_posts_settings['portfolio_single_layout_column'];
}
return apply_filters( 'a3_portfolio_single_get_layout_column', $layout_column, $portfolio_id );
}
/**
* a3_portfolio_single_get_layout_column_class()
*
* @return string
*/
function a3_portfolio_single_get_layout_column_class( $portfolio_id = 0 ) {
if ( $portfolio_id < 1 ) {
$portfolio_id = get_the_ID();
}
$layout_column = a3_portfolio_single_get_layout_column( $portfolio_id );
$a3_portfolio_single_column_class = 'single-a3-portfolio-2-column';
if ( 1 == $layout_column ) {
$a3_portfolio_single_column_class = 'single-a3-portfolio-1-column';
}
return apply_filters( 'a3_portfolio_single_get_layout_column_class', $a3_portfolio_single_column_class, $portfolio_id );
}
?>