';
if( $navigate_through_categories ) {
next_post_link( '%link', '
', true, '', A13FRAMEWORK_CPT_ALBUM_TAXONOMY );
}
else{
next_post_link( '%link', '
' );
}
echo $show_back_btn? '
' : '';
if( $navigate_through_categories ) {
previous_post_link( '%link', '
', true, '', A13FRAMEWORK_CPT_ALBUM_TAXONOMY );
}
else{
previous_post_link( '%link', '
' );
}
echo '
';
}
}
if(!function_exists('apollo13framework_albums_outside_nav')){
/**
* Prints navigation for albums outside of text content
* @since 2.3.0
*/
function apollo13framework_albums_outside_nav() {
global $apollo13framework_a13;
$show_back_btn = true;
$title = $href = '';
$navigate_through_categories = $apollo13framework_a13->get_option( 'album_navigate_by_categories' ) === 'on';
if($navigate_through_categories){
$term_list = wp_get_post_terms(get_the_ID(), A13FRAMEWORK_CPT_ALBUM_TAXONOMY, array("fields" => "all"));
$count_terms = count( $term_list );
if($count_terms > 0){
$term = $term_list[0];
/* translators: %s: page title */
$title = sprintf(esc_html__( 'Back to %s', 'rife-free' ), $term->name);
$href = get_term_link($term);
}
else{
$show_back_btn = false;
}
}
else{
$albums_id = $apollo13framework_a13->get_option( 'albums_list_page' );
/* translators: %s: page title */
$title = sprintf(esc_html__( 'Back to %s', 'rife-free' ), get_the_title( $albums_id ));
if($albums_id !== '0'){
$href = get_permalink($albums_id);
}
//albums list as front page
elseif($apollo13framework_a13->get_option( 'fp_variant' ) === 'albums_list'){
$href = home_url( '/' );
}
else{
$show_back_btn = false;
}
}
echo '';
if( $navigate_through_categories ) {
next_post_link( '%link', '
' . esc_html__( 'Previous', 'rife-free' ), true, '', A13FRAMEWORK_CPT_ALBUM_TAXONOMY );
}
else {
next_post_link( '%link', '
' . esc_html__( 'Previous', 'rife-free' ) );
}
echo $show_back_btn? '
' : '';
if( $navigate_through_categories ) {
previous_post_link( '%link', esc_html__( 'Next', 'rife-free' ) . '
', true, '', A13FRAMEWORK_CPT_ALBUM_TAXONOMY );
}
else{
previous_post_link( '%link', esc_html__( 'Next', 'rife-free' ) . '
' );
}
echo '
';
}
}
if(!function_exists('apollo13framework_album_text_content')){
/**
* Displays text content block for album
*/
function apollo13framework_album_text_content() {
global $apollo13framework_a13;
apollo13framework_albums_nav();
if( $apollo13framework_a13->get_option( 'album_content_categories') === 'on'){
//apollo13framework_album_posted_in() produces escaped content
echo '
get_option( 'albums_list_lazy_load' ) === 'on';
$lazy_load_mode = $apollo13framework_a13->get_option( 'albums_list_lazy_load_mode' );
echo ' data-lazy-load="' . esc_attr( $lazy_load ) . '" data-lazy-load-mode="' . esc_attr( $lazy_load_mode ) . '"';
}
echo ' data-margin="' . esc_attr( $args['margin'] ) . '"';
?>>
have_posts() ) :
//apollo13framework_albums_list_item() produces escaped content
echo apollo13framework_albums_list_item($query, $displayed_in, $args );
endwhile;
if ( ! $ajax_call ) { ?>
';
//simple for albums list or shortcode
if ( $album_list || $shortcode ) {
$html .= apollo13framework_make_album_image( $post_id, '', $args );
} //fixed for other place
else {
//prepare image in proportion
$image_width = 800;/* 800 - not depending on current theme settings for albums list */
$brick_proportion = $apollo13framework_a13->get_option( 'albums_list_bricks_proportions_size' );
$height_proportion = apollo13framework_calculate_height_proportion( $brick_proportion );
$image_height = $image_width * $height_proportion;
$html .= apollo13framework_make_album_image( $post_id, array( $image_width, $image_height ) );
}
$cover_color = $apollo13framework_a13->get_meta( '_cover_color' );
if ( $cover_color === '' || $cover_color === false || $cover_color === 'transparent' ) {
//no color - default to CSS value
$html .= '
';
} else {
$html .= '
';
}
$html .= '
';
$html .= '
';
$html .= '
';
if ( post_password_required( $post_id ) ) {
$html .= '
';
$html .= '
';
if( $apollo13framework_a13->get_option( 'albums_list_protected_titles', 'on' ) === 'on' ){
$html .= '' . esc_html__( 'This content is password protected', 'rife-free' );
}
else{
$html .= '' . get_the_title($post_id);
}
$html .= '
';
$html .= '
';
$html .= '
' . esc_html__( 'Click and enter your password to view content', 'rife-free' ) . '
';
$html .= '
';
$html .= '
';
} else {
$html .= '
';
//return taxonomy for albums
if ( $apollo13framework_a13->get_option( 'albums_list_categories' ) === 'on' ) {
//apollo13framework_album_posted_in() produces escaped content
$html .= '
' . apollo13framework_album_posted_in( ', ' ) . '
';
}
//title
$html .= the_title( '
', '
', false );
$html .= '
';
$html .= esc_html( $apollo13framework_a13->get_meta( '_subtitle' ) );
$html .= '
';
$html .= '
';
}
$html .= '
'; //.caption
$html .= '
';
$html .= apollo13framework_cpt_social($href, get_the_title());
$html .= '
';
}
return $html;
}
}
if(!function_exists('apollo13framework_albums_list_individual_look')){
/**
* Prepares CSS specially for each albums list
*
* @since 2.1.0
*
* @param $id int unique id for current albums list
* @param $args array custom params for albums list
*/
function apollo13framework_albums_list_individual_look($id, $args){
$css = '';
$max_width = (int) $args['max_width'];
$max_width = esc_html( apollo13framework_make_css_rule( 'max-width', $max_width, '%spx' ) );
$margin = (int) $args['margin'];
$margin = esc_html( $margin . 'px' );
$calc_safe_margin = esc_html( $margin === '0px' ? '' : ' - ' . $margin );
//space in case of different layout mode
$item_bottom_gutter = wp_strip_all_tags( 'margin-bottom: ' . $margin . ';' );
$selector_class = wp_strip_all_tags( '.albums-bricks-' . $id );
$css .= '
'.$selector_class.'{
'.$max_width.'
}
'.$selector_class.' .albums-grid-container{
margin-right: -'.$margin.';
}
.rtl '.$selector_class.' .albums-grid-container{
margin-right: 0;
margin-left: -'.$margin.';
}
'.$selector_class.' .layout-fitRows .archive-item,
'.$selector_class.' .layout-masonry .archive-item{
'.$item_bottom_gutter.'
}
/* 4 columns */
'.$selector_class.'.albums-columns-4 .archive-item,
'.$selector_class.'.albums-columns-4 .grid-master{
width: calc(25%'.$calc_safe_margin.');
}
'.$selector_class.'.albums-columns-4 .archive-item.w2{
width: calc(50%'.$calc_safe_margin.');
}
'.$selector_class.'.albums-columns-4 .archive-item.w3{
width: calc(75%'.$calc_safe_margin.');
}
/* 3 columns */
'.$selector_class.'.albums-columns-3 .archive-item,
'.$selector_class.'.albums-columns-3 .grid-master{
width: calc(33.3333333%'.$calc_safe_margin.');
}
'.$selector_class.'.albums-columns-3 .archive-item.w2{
width: calc(66.6666666%'.$calc_safe_margin.');
}
/* 2 columns */
'.$selector_class.'.albums-columns-2 .archive-item,
'.$selector_class.'.albums-columns-2 .grid-master{
width: calc(50%'.$calc_safe_margin.');
}
/* 100% width bricks */
'.$selector_class.'.albums-columns-1 .grid-master,
'.$selector_class.'.albums-columns-1 .archive-item,
'.$selector_class.'.albums-columns-2 .archive-item.w2,
'.$selector_class.'.albums-columns-2 .archive-item.w3,
'.$selector_class.'.albums-columns-2 .archive-item.w4,
'.$selector_class.'.albums-columns-3 .archive-item.w3,
'.$selector_class.'.albums-columns-3 .archive-item.w4,
'.$selector_class.'.albums-columns-4 .archive-item.w4{
width: calc(100%'.$calc_safe_margin.');
}
@media only screen and (max-width: 1279px){
/* 4 -> 3 columns */
.albums-columns-4 .archive-item,
.albums-columns-4 .grid-master{
width: calc(33.3333333%'.$calc_safe_margin.');
}
.albums-columns-4 .archive-item.w2{
width: calc(66.6666666%'.$calc_safe_margin.');
}
.albums-columns-4 .archive-item.w3{
width: calc(100%'.$calc_safe_margin.');
}
}
@media only screen and (max-width: 800px){
/* 4,3 -> 2 columns */
'.$selector_class.'.albums-columns-4 .grid-master,
'.$selector_class.'.albums-columns-4 .archive-item,
'.$selector_class.'.albums-columns-4 .archive-item.w2,
'.$selector_class.'.albums-columns-3 .grid-master,
'.$selector_class.'.albums-columns-3 .archive-item{
width: calc(50%'.$calc_safe_margin.');
}
'.$selector_class.'.albums-columns-4 .archive-item.w3,
'.$selector_class.'.albums-columns-3 .archive-item.w2{
width: calc(100%'.$calc_safe_margin.');
}
}
@media only screen and (max-width: 480px) {
'.$selector_class.' .albums-grid-container{
margin-right: 0;
}
.rtl '.$selector_class.' .albums-grid-container{
margin-left: 0;
}
/* all bricks layouts -> 1 column */
'.$selector_class.'.albums-columns-4 .grid-master,
'.$selector_class.'.albums-columns-4 .archive-item,
'.$selector_class.'.albums-columns-4 .archive-item.w2,
'.$selector_class.'.albums-columns-4 .archive-item.w3,
'.$selector_class.'.albums-columns-4 .archive-item.w4,
'.$selector_class.'.albums-columns-3 .grid-master,
'.$selector_class.'.albums-columns-3 .archive-item,
'.$selector_class.'.albums-columns-3 .archive-item.w2,
'.$selector_class.'.albums-columns-3 .archive-item.w3,
'.$selector_class.'.albums-columns-2 .grid-master,
'.$selector_class.'.albums-columns-2 .archive-item,
'.$selector_class.'.albums-columns-2 .archive-item.w2,
'.$selector_class.'.albums-columns-1 .grid-master,
'.$selector_class.'.albums-columns-1 .archive-item{
width: 100%;
}
}';
//if we have some CSS then add it
if(strlen($css)){
$css = apollo13framework_minify_css($css);
// Elementor edit mode
if ( defined('ELEMENTOR_VERSION') && \Elementor\Plugin::$instance->editor->is_edit_mode() ) {
//we need to print inline CSS this way, cause otherwise it will be enqueued in frame parent(wrong place)
echo '';
}
// not edit mode
else {
//print albums grid inline CSS without attaching it to any style
//credits to https://www.cssigniter.com/late-enqueue-inline-css-wordpress/
wp_register_style( 'a13-albums-grid-'.esc_attr($id), false );
wp_enqueue_style( 'a13-albums-grid-'.esc_attr($id) );
wp_add_inline_style( 'a13-albums-grid-'.esc_attr($id), $css );
}
}
}
}