1, 'itemscope' => 'itemscope', 'itemtype' => 'http://schema.org/WPSideBar' ); ?>
'; } else { echo '
'; } ?>
'; echo wp_kses_post( $styles ); echo ''; if ( ( 'img' == $headertype['value'] && ! empty( $url ) ) || 'bgcolour' == $headertype['value'] ) { ?>

'; } ?>
'; echo wp_kses_post( $styles ); echo ''; if ( ( 'img' == $headertype && ! empty( $url ) ) || 'bgcolour' == $headertype ) { ?>

'; } ?>
term_id; $headertype = get_term_meta( $cid, 'dbacf_header_type', true ); if ( $headertype && ( 'img' == $headertype || 'bgcolour' == $headertype ) ) { if ( 'img' == $headertype ) { $img_size = get_term_meta( $cid, 'dbacf_header_img_dbacf_bg_img_size', true ); // Image location $img_from = get_term_meta( $cid, 'dbacf_header_img_dbacf_img_from', true ); if ( $img_from && 'featured' == $img_from ) { if ( has_post_thumbnail() ) { $url = get_the_post_thumbnail_url( get_the_ID(), 'full' ); $imgid = get_post_thumbnail_id(); } } elseif ( 'upload' == $img_from ) { $upl_img = get_term_meta( $cid, 'dbacf_header_img_dbacf_upload_img', true ); if ( ! empty( $upl_img ) ) { $url = wp_get_attachment_image_src( $upl_img, 'full' ); $imgid = $upl_img; }; } // Image position $bg_pos = get_term_meta( $cid, 'dbacf_header_img_dbacf_bg_position', true ); if ( $bg_pos && 'x-y' == $bg_pos ) { $x_pos = get_term_meta( $cid, 'dbacf_header_img_dbacf_x_position', true ); $y_pos = get_term_meta( $cid, 'dbacf_header_img_dbacf_y_position', true ); $img_pos = $x_pos . '%' . ' ' . $y_pos . '%'; } else { $img_pos = $bg_pos; } //Image filter $img_filter = get_term_meta( $cid, 'dbacf_header_img_dbacf_img_filter', true ); if ( $img_filter && 'none' !== $img_filter ) { $img_filter_pc = get_term_meta( $cid, 'dbacf_header_img_dbacf_img_filter_percent', true ); if ( $img_filter_pc ) { $img_filter_txt = $img_filter . '(' . $img_filter_pc . '%)'; } } //Image background repeat $img_repeat = get_term_meta( $cid, 'dbacf_header_img_dbacf_bg_repeat', true ); if ( empty( $img_repeat ) ) { $img_repeat = 'no-repeat'; } } //Header $imgbgcolour = get_term_meta( $cid, 'dbacf_header_bg_colour', true ); $img_width = get_term_meta( $cid, 'dbacf_header_width', true ); if ( empty( $img_width ) ) { $img_width = 'full-width'; } $img_ht = get_term_meta( $cid, 'dbacf_header_height', true ); $mimg_ht = get_term_meta( $cid, 'dbacf_header_smldev_height', true ); if ( ! $img_ht ) { $img_ht = 280; } //Titles $styles = ''; $showheadertitle = get_term_meta( $cid, 'dbacf_show_title_on_header', true ); $headertitlecolor = get_term_meta( $cid, 'dbacf_title_colour_on_header', true ); $centertitle = get_term_meta( $cid, 'dbacf_center_title', true ); if ( ! $centertitle ) { $hpos = get_term_meta( $cid, 'dbacf_horizontal_pos', true ); if ( '' == $hpos ) { $hpos = 'left'; } $vpos = get_term_meta( $cid, 'dbacf_vertical_pos', true ); if ( '' == $vpos ) { $vpos = 'top'; } $title_x = get_term_meta( $cid, 'dbacf_title_x', true ); $title_y = get_term_meta( $cid, 'dbacf_title_y', true ); } if ( $showheadertitle && true == $showheadertitle ) { // show title if ( ! $centertitle ) { $styles .= '.titlepos { position: absolute; '; $styles .= $hpos . ': ' . esc_attr( $title_x ) . 'px; '; $styles .= $vpos . ': ' . esc_attr( $title_y ) . 'px; }'; } else { $styles .= '.titlepos { position: absolute; '; $styles .= 'top: 50%; left: 50%; transform: translate(-50%, -50%); }'; } if ( ! empty( $headertitlecolor ) ) { $styles .= '.dba-img-title { color: ' . esc_attr( $headertitlecolor ) . '; }'; } } // Subtitle $showsubtitle = get_term_meta( $cid, 'dbacf_show_subtitle', true ); if ( $showsubtitle && true == $showsubtitle ) { $headersubtitle = get_term_meta( $cid, 'dbacf_header_subtitle', true ); $showsubtitlefrom = get_term_meta( $cid, 'dbacf_header_subtitle_dbacf_show_subtitle_from', true ); if ( $showsubtitlefrom ) { switch ( $showsubtitlefrom ) { case 'customtext': $subtitle = get_term_meta( $cid, 'dbacf_header_subtitle_dbacf_subtitle', true ); break; case 'excerpt': if ( is_category() || is_tag() || is_author() ) { $subtitle = get_the_archive_description(); } else { $subtitle = ( has_excerpt() ? get_the_excerpt() : '' ); } break; case 'customfield': $customfieldname = get_term_meta( $cid, 'dbacf_header_subtitle_dbacf_subtitle_field_name', true ); if ( $customfieldname ) { $subtitle = get_term_meta( $cid, $customfieldname, true ); } break; } } if ( true == $showheadertitle ) { //show title & subtitle $styles .= '.subtitlepos { padding: 5px 10px 0 ; }'; } elseif ( false == $showheadertitle ) { // show subtitle only if ( ! $centertitle ) { $styles .= '.subtitlepos { position: absolute; '; $styles .= $hpos . ': ' . esc_attr( $title_x ) . 'px; '; $styles .= $vpos . ': ' . esc_attr( $title_y ) . 'px; }'; } else { $styles .= '.subtitlepos { position: absolute; '; $styles .= 'top: 50%; left: 50%; transform: translate(-50%, -50%); }'; } } if ( ! empty( $headertitlecolor ) ) { $styles .= '.dba-img-subtitle { color: ' . esc_attr( $headertitlecolor ) . '; }'; } } $styles .= '.dba-headerimg { position: relative; }'; if ( 'img' == $headertype ) { $styles .= '.img-cover { '; $styles .= 'background-color: ' . esc_attr( $imgbgcolour ) . '; '; $styles .= 'background-size: ' . esc_attr( $img_size ) . '; '; $styles .= 'background-position: ' . esc_attr( $img_pos ) . '; '; $styles .= 'height: ' . esc_attr( $img_ht ) . 'px; '; $styles .= 'background-repeat: ' . esc_attr( $img_repeat ) . '; '; if ( $img_filter && 'none' !== $img_filter && $img_filter_pc ) { $styles .= 'filter: ' . esc_attr( $img_filter_txt ) . '; '; $styles .= '-webkit-filter: ' . esc_attr( $img_filter_txt ) . '; '; } $styles .= '}'; $styles .= dfu_busacc_fn_get_reponsive_img_css( $imgid, '.img-cover' ); } elseif ( 'bgcolour' == $headertype ) { $styles .= '.img-cover { '; $styles .= 'background-color: ' . esc_attr( $imgbgcolour ) . '; '; $styles .= 'height: ' . esc_attr( $img_ht ) . 'px; }'; } $styles .= '@media screen and (max-width: 767px) { '; $styles .= '.img-cover { '; $styles .= 'height: ' . esc_attr( $mimg_ht ) . 'px; }'; $styles .= '}'; echo ''; if ( ( 'img' == $headertype && ! empty( $url ) ) || 'bgcolour' == $headertype ) { ?>

'; } ?>
'post_types_info', 'posts_per_page' => 1, 'post_status' => 'publish', 'meta_key' => 'dbacf_ptype', 'meta_value' => $achiveposttype, 'order' => 'DESC', 'orderby' => 'date', ); $ptiquery = new WP_Query( $ptiargs ); if ( $ptiquery->have_posts() ) { while ( $ptiquery->have_posts() ) { $ptiquery->the_post(); $fwidth = dfu_busacc_fn_get_footer_width_class(); } wp_reset_postdata(); } } } else { $fwidth = dfu_busacc_fn_get_footer_width_class(); } } elseif ( is_category() || is_tag() || is_tax() ) { $term = get_queried_object(); $fwidth = dfu_busacc_fn_get_footer_width_class( $term ); } else { $fwidth = dfu_busacc_fn_get_footer_width_class(); } return $fwidth; } } if ( ! function_exists( 'dfu_busacc_fn_get_footer_width_class' ) ) { function dfu_busacc_fn_get_footer_width_class( $term = '' ) { $fwidth = ''; if ( function_exists( 'get_field' ) ) { $fwidth = get_field( 'dbacf_footer_width', $term ); } else { // ACF not available if ( empty( $term ) ) { $term = get_the_ID(); } $fwidth = get_post_meta( $term, 'dbacf_footer_width', true ); } if ( '' == $fwidth ) { $fwidth = get_theme_mod( 'dba_footer_width', 'container' ); } return $fwidth; } } /** * Add sections (section is added on front page one at a time) *******************************************************************************************************************************************/ if ( ! function_exists( 'dfu_busacc_fn_add_sections' ) ) { function dfu_busacc_fn_add_sections( $sectid, $term = '' ) { if ( function_exists( 'have_rows' ) ) { if ( have_rows( 'dbacf_sections', $term ) ) : ?>
post_name; ?>
'; echo '.dba-cont-bg.' . esc_attr( $sectname ) . ' {' . esc_attr( $contentstylexs ) . '}'; echo '.dba-sect-content.' . esc_attr( $sectname ) . ' {width:100%} '; echo '@media (min-width:576px) {'; echo '.dba-cont-bg.' . esc_attr( $sectname ) . ' {' . esc_attr( $contentstylesm ) . '}'; echo '.dba-sect-content.' . esc_attr( $sectname ) . ' {width:100%} '; echo '} '; echo '@media (min-width:768px) {'; echo '.dba-cont-bg.' . esc_attr( $sectname ) . ' {' . esc_attr( $contentstylemd ) . '}'; echo '.dba-sect-content.' . esc_attr( $sectname ) . ' {width:' . esc_attr( $medperc ) . '%;' . ( ! empty( $contentpad ) ? 'padding:' . esc_attr( $contentpad ) . 'rem;' : '' ) . '}'; echo '} '; echo '@media (min-width:992px) {'; echo '.dba-cont-bg.' . esc_attr( $sectname ) . ' {' . esc_attr( $contentstylelg ) . '}'; echo '.dba-sect-content.' . esc_attr( $sectname ) . ' {width:' . esc_attr( $contentperc ) . '%;' . ( ! empty( $contentpad ) ? 'padding:' . esc_attr( $contentpad ) . 'rem;' : '' ) . '}'; echo '}'; echo '@media (min-width:1200px) {'; echo '.dba-cont-bg.' . esc_attr( $sectname ) . ' {' . esc_attr( $contentstylefull ) . '}'; echo '.dba-sect-content.' . esc_attr( $sectname ) . ' {width:' . esc_attr( $contentperc ) . '%;' . ( ! empty( $contentpad ) ? 'padding:' . esc_attr( $contentpad ) . 'rem;' : '' ) . '}'; echo '}'; echo ''; ?>
>

post_name; ?>
max_num_pages; if ( ! $pages ) { $pages = 1; } } if ( 1 != $pages ) { echo '
'; echo ''; echo '
'; } } } /** * Page divider *******************************************************************************************************************************************/ if ( ! function_exists( 'dfu_busacc_fn_display_divider' ) ) { function dfu_busacc_fn_display_divider( $id, $dstyle, $top, $btm ) { if ( ! empty( $dstyle ) && 'none' != $dstyle ) { ?>
'; } else { if ( substr( $icostyle, 0, 3 ) === 'fas' ) { $dispstr = ''; } else { $dispstr = ''; } } endif; return $dispstr; } } /** * Prints HTML with meta information for the current post-date/time and author. *******************************************************************************************************************************************/ if ( ! function_exists( 'dfu_busacc_fn_blog_header' ) ) { function dfu_busacc_fn_blog_header() { if ( function_exists( 'get_field' ) ) { $showpostdate = get_field( 'dbacf_post_show_date' ); $showauthor = get_field( 'dbacf_post_show_author' ); } else { $showpostdate = get_post_meta( get_the_ID(), 'dbacf_post_show_date', true ); $showauthor = get_post_meta( get_the_ID(), 'dbacf_post_show_author', true ); } $showheadicon = get_theme_mod( 'dba_blog_show_header_ico' ); $datetouse = get_theme_mod( 'dba_blog_date_to_use', 'update' ); if ( 'update' == $datetouse ) { $time_string = ''; $time_string = sprintf( $time_string, esc_attr( get_the_modified_date( DATE_W3C ) ), esc_html( get_the_modified_date() ), esc_attr( get_the_date( DATE_W3C ) ) ); } else { $time_string = ''; $time_string = sprintf( $time_string, esc_attr( get_the_date( DATE_W3C ) ), esc_html( get_the_date() ) ); } if ( $showpostdate ) { $postontitle = ( 'update' == $datetouse ? esc_html__( 'Last updated', 'dfu-busacc' ) : esc_html__( 'Created', 'dfu-busacc' ) ); $posted_on = sprintf( /* translators: %s: post date. */ $postontitle . esc_html_x( ' on %s', 'post date', 'dfu-busacc' ), '' . $time_string . '' ); if ( $showheadicon && true == $showheadicon ) { if ( true == get_theme_mod( 'dba_load_fa', true ) ) { $postedonicon = apply_filters( 'dfu_busacc_f_postedon_faicon', '' ); $posted_on = '' . wp_kses_post( $postedonicon ) .' ' . $posted_on; } else { $postedonicon = apply_filters( 'dfu_busacc_f_postedon_icon', '' ); $posted_on = '' . wp_kses_post( $postedonicon ) . ' ' . $posted_on; } } echo '' . $posted_on . ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } if ( $showauthor ) { if ( function_exists( 'get_field' ) ) { $linktoauthor = get_field( 'dbacf_post_link_author' ); } else { $linktoauthor = get_post_meta( get_the_ID(), 'dbacf_post_link_author', true ); } if ( $showpostdate ) { // post date is shown if ( $linktoauthor ) { $byline = sprintf( /* translators: 1: by */ esc_html_x( ' by %s', 'post author', 'dfu-busacc' ), '' ); } else { $byline = sprintf( /* translators: 1: by */ esc_html_x( ' by %s', 'post author', 'dfu-busacc' ), '' ); } } else { if ( $linktoauthor ) { $byline = sprintf( /* translators: 1: Posted by */ esc_html_x( 'Posted by %s', 'post author', 'dfu-busacc' ), '' ); } else { $byline = sprintf( /* translators: 1: Posted by */ esc_html_x( 'Posted by %s', 'post author', 'dfu-busacc' ), '' ); } } if ( $showheadicon && true == $showheadicon ) { if ( true == get_theme_mod( 'dba_load_fa', true ) ) { $postedbyicon = apply_filters( 'dfu_busacc_f_postedby_faicon', '' ); $byline = ( $showpostdate ? ' ' : '' ) . '' . wp_kses_post( $postedbyicon ) . '' . $byline; } else { $postedbyicon = apply_filters( 'dfu_busacc_f_postedby_icon', '' ); $byline = ( $showpostdate ? ' ' : '' ) . '' . wp_kses_post( $postedbyicon ) . '' . $byline; } } echo ''; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } } /** * Prints HTML with meta information for the categories, tags and comments. *******************************************************************************************************************************************/ if ( ! function_exists( 'dfu_busacc_fn_blog_footer' ) ) { function dfu_busacc_fn_blog_footer() { if ( function_exists( 'get_field' ) ) { $showcat = get_field( 'dbacf_post_show_category' ); $showtag = get_field( 'dbacf_post_show_tags' ); } else { $showcat = get_post_meta( get_the_ID(), 'dbacf_post_show_category', true ); $showtag = get_post_meta( get_the_ID(), 'dbacf_post_show_tags', true ); } $showfooticon = get_theme_mod( 'dba_blog_show_footer_ico' ); if ( $showfooticon && true == $showfooticon ) { if ( true == get_theme_mod( 'dba_load_fa', true ) ) { $caticon = apply_filters( 'dfu_busacc_f_cat_faicon', '' ); $catline = '' . wp_kses_post( $caticon ) . ' '; } else { $caticon = apply_filters( 'dfu_busacc_f_cat_icon', '' ); $catline = '' . wp_kses_post( $caticon ) . ' '; } if ( true == get_theme_mod( 'dba_load_fa', true ) ) { $tagicon = apply_filters( 'dfu_busacc_f_tag_faicon', '' ); $tagline = '' . wp_kses_post( $tagicon ) . ' '; } else { $tagicon = apply_filters( 'dfu_busacc_f_tag_icon', '' ); $tagline = '' . wp_kses_post( $tagicon ) . ' '; } } else { $catline = ''; $tagline = ''; } // category and tag text for posts only. if ( 'post' === get_post_type() ) { /* translators: used between list items, there is a space after the comma */ if ( $showcat ) { $categories_list = get_the_category_list( esc_html__( ', ', 'dfu-busacc' ) ); if ( $categories_list ) { /* translators: 1: list of categories. */ printf( '', $categories_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped } } /* translators: used between list items, there is a space after the comma */ if ( $showtag ) { $tagusebadge = get_theme_mod( 'dba_blog_tag_use_badge', false ); if ( $tagusebadge ) { $tags_list = get_the_tag_list( '', ' ' ); } else { $tags_list = get_the_tag_list( '', esc_html_x( ', ', 'list item separator', 'dfu-busacc' ) ); } if ( $tags_list ) { /* translators: 1: list of tags. */ printf( '', $tags_list ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> '; comments_popup_link( sprintf( wp_kses( /* translators: %s: post title */ __( 'Leave a Comment on %s', 'dfu-busacc' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ) ); echo '
'; } edit_post_link( sprintf( wp_kses( /* translators: %s: Name of current post. Only visible to screen readers */ __( 'Edit %s', 'dfu-busacc' ), array( 'span' => array( 'class' => array(), ), ) ), get_the_title() ), '' ); } } /** * Get ACF group fields without ACF *******************************************************************************************************************************************/ if ( ! function_exists( 'dfu_busacc_fn_get_group_fields' ) ) { function dfu_busacc_fn_get_group_fields( $group_name ) { $group = get_page_by_title( html_entity_decode( $group_name ), OBJECT, 'acf' ); if ( empty( $group ) ) { return false; } $meta = get_post_meta( $group->ID ); $acf_fields = array(); foreach ( $meta as $key => $value ) { $acf_meta_key = stristr( $key, 'field_' ); // acf fields all start with "field_" if ( $acf_meta_key ) { $acf_fields[] = get_field_object( $key ); } } return $acf_fields; // returns an array of field objects } } /** * Get theme colours based on primary and/or secondary colour(s) *******************************************************************************************************************************************/ if ( ! function_exists( 'dfu_busacc_fn_theme_colours' ) ) { function dfu_busacc_fn_theme_colours( $pri, $sec = '' ) { $colors = array(); $colors['pri'] = $pri; if ( '' == $sec ) { $sec = dfu_busacc_fn_getcomplementarycolour( $pri ); } $colors['sec'] = $sec; $themetype = dfu_busacc_fn_colourcheck( $pri ); if ( 'dk' == $themetype ) { $colors['pri_lt20'] = dfu_busacc_fn_hextint( $pri, 0.2, 't' ); $colors['pri_lt65'] = dfu_busacc_fn_hextint( $pri, 0.65, 't' ); $colors['pri_lt75'] = dfu_busacc_fn_hextint( $pri, 0.75, 't' ); $colors['pri_lt85'] = dfu_busacc_fn_hextint( $pri, 0.85, 't' ); $colors['pri_lt90'] = dfu_busacc_fn_hextint( $pri, 0.9, 't' ); $colors['pri_lt95'] = dfu_busacc_fn_hextint( $pri, 0.95, 't' ); $colors['pri_dk30'] = dfu_busacc_fn_hextint( $pri, 0.3, 's' ); $colors['pri_dk40'] = dfu_busacc_fn_hextint( $pri, 0.4, 's' ); $colors['sec_lt60'] = dfu_busacc_fn_hextint( $sec, 0.6, 't' ); $colors['sec_lt70'] = dfu_busacc_fn_hextint( $sec, 0.7, 't' ); $colors['sec_lt80'] = dfu_busacc_fn_hextint( $sec, 0.8, 't' ); $colors['sec_lt90'] = dfu_busacc_fn_hextint( $sec, 0.9, 't' ); $colors['sec_lt95'] = dfu_busacc_fn_hextint( $sec, 0.95, 't' ); $colors['sec_dk30'] = dfu_busacc_fn_hextint( $sec, 0.3, 's' ); $colors['sec_dk40'] = dfu_busacc_fn_hextint( $sec, 0.4, 's' ); $colors['pri_txt'] = dfu_busacc_fn_getcontrastcolour( $pri, 1 ); $colors['pri_txt_dk'] = dfu_busacc_fn_getcontrastcolour( $pri, 2 ); } elseif ( 'lt' == $themetype ) { $colors['pri_lt20'] = dfu_busacc_fn_hextint( $pri, 0.8, 's' ); $colors['pri_lt65'] = dfu_busacc_fn_hextint( $pri, 0.7, 's' ); $colors['pri_lt75'] = dfu_busacc_fn_hextint( $pri, 0.6, 's' ); $colors['pri_lt85'] = dfu_busacc_fn_hextint( $pri, 0.5, 's' ); $colors['pri_lt90'] = dfu_busacc_fn_hextint( $pri, 0.85, 't' ); $colors['pri_lt95'] = dfu_busacc_fn_hextint( $pri, 0.95, 't' ); $colors['pri_dk30'] = dfu_busacc_fn_hextint( $pri, 0.4, 't' ); $colors['pri_dk40'] = dfu_busacc_fn_hextint( $pri, 0.3, 't' ); $colors['sec_lt60'] = dfu_busacc_fn_hextint( $sec, 0.65, 't' ); $colors['sec_lt70'] = dfu_busacc_fn_hextint( $sec, 0.55, 's' ); $colors['sec_lt80'] = dfu_busacc_fn_hextint( $sec, 0.45, 's' ); $colors['sec_lt90'] = dfu_busacc_fn_hextint( $sec, 0.35, 's' ); $colors['sec_lt95'] = dfu_busacc_fn_hextint( $sec, 0.95, 't' ); $colors['sec_dk30'] = dfu_busacc_fn_hextint( $sec, 0.4, 't' ); $colors['sec_dk40'] = dfu_busacc_fn_hextint( $sec, 0.3, 't' ); $colors['pri_txt'] = dfu_busacc_fn_getcontrastcolour( $pri, 1 ); $colors['pri_txt_dk'] = dfu_busacc_fn_getcontrastcolour( $pri, 2 ); } return $colors; } } /** * Get footer icon background light or dark *******************************************************************************************************************************************/ if ( ! function_exists( 'dfu_busacc_fn_footer_iconbg' ) ) { function dfu_busacc_fn_footer_iconbg() { $btngrad = get_theme_mod( 'dba_btn_grad', false ); if ( $btngrad ) { $btnbgcolor = get_theme_mod( 'dba_btn_first' ); } else { $btndefault = array( 'text' => '#f0f1f2', 'htext' => '#fcfcfc', 'bg' => '#0088cc', 'hbg' => '#006191', ); $btncol = get_theme_mod( 'dba_button', $btndefault ); $btnbgcolor = $btncol['bg']; } $ctype = dfu_busacc_fn_colourcheck( $btnbgcolor ); $iconbgcolor = ( 'lt' == $ctype ? 'dk' : 'lt' ); return $iconbgcolor; } } if ( ! function_exists( 'dfu_busacc_fn_default_header_slider' ) ) { function dfu_busacc_fn_default_header_slider() { $dfu_busacc_headerimgs[1] = '/inc/assets/img/1046491-pxhere.jpg'; $dfu_busacc_headerimgs[2] = '/inc/assets/img/334581-pxhere.jpg'; $dfu_busacc_j = 0; foreach ( $dfu_busacc_headerimgs as $dfu_busacc_headerimg ) { ?>