';
if ( is_day() ) :
/* translators: %1$s %2$s: date */
printf( esc_html__( '%1$s %2$s', 'atua' ), esc_html__('Archives','atua'), get_the_date() );
elseif ( is_month() ) :
/* translators: %1$s %2$s: month */
printf( esc_html__( '%1$s %2$s', 'atua' ), esc_html__('Archives','atua'), get_the_date( 'F Y' ) );
elseif ( is_year() ) :
/* translators: %1$s %2$s: year */
printf( esc_html__( '%1$s %2$s', 'atua' ), esc_html__('Archives','atua'), get_the_date( 'Y' ) );
elseif( is_author() ):
/* translators: %1$s %2$s: author */
printf( esc_html__( '%1$s %2$s', 'atua' ), esc_html__('All posts by','atua'), get_the_author() );
elseif( is_category() ):
/* translators: %1$s %2$s: category */
printf( esc_html__( '%1$s %2$s', 'atua' ), esc_html__('Category','atua'), single_cat_title( '', false ) );
elseif( is_tag() ):
/* translators: %1$s %2$s: tag */
printf( esc_html__( '%1$s %2$s', 'atua' ), esc_html__('Tag','atua'), single_tag_title( '', false ) );
elseif( class_exists( 'WooCommerce' ) && is_shop() ):
/* translators: %1$s %2$s: WooCommerce */
printf( esc_html__( '%1$s %2$s', 'atua' ), esc_html__('Shop','atua'), single_tag_title( '', false ));
elseif( is_archive() ):
the_archive_title( '
', '
' );
endif;
echo '';
}
elseif( is_404() )
{
echo '';
/* translators: %1$s: 404 */
printf( esc_html__( '%1$s ', 'atua' ) , esc_html__('404','atua') );
echo '
';
}
elseif( is_search() )
{
echo '';
/* translators: %1$s %2$s: search */
printf( esc_html__( '%1$s %2$s', 'atua' ), esc_html__('Search results for','atua'), get_search_query() );
echo '
';
}
else
{
echo ''.esc_html( get_the_title() ).'
';
}
}
/**
* Theme Breadcrumbs Url
*/
function atua_page_url() {
$page_url = 'http';
if ( key_exists("HTTPS", $_SERVER) && ( $_SERVER["HTTPS"] == "on" ) ){
$page_url .= "s";
}
$page_url .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$page_url .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$page_url .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $page_url;
}
/**
* Theme Breadcrumbs
*/
if( !function_exists('atua_page_header_breadcrumbs') ):
function atua_page_header_breadcrumbs() {
global $post;
$homeLink = home_url();
if (is_home() || is_front_page()) :
echo ''.__('Home','atua').'';
echo ''; echo single_post_title(); echo '';
else:
echo ''.__('Home','atua').'';
if ( is_category() ) {
echo '' . __('Archive by category','atua').' "' . single_cat_title('', false) . '"';
} elseif ( is_day() ) {
echo ''. get_the_time('Y') .'';
echo ''. get_the_time('F') .'';
echo ''. get_the_time('d') .'';
} elseif ( is_month() ) {
echo '' . get_the_time('Y') . '';
echo ''. get_the_time('F') .'';
} elseif ( is_year() ) {
echo ''. get_the_time('Y') .'';
} elseif ( is_single() && !is_attachment() && is_page('single-product') ) {
if ( get_post_type() != 'post' ) {
$cat = get_the_category();
$cat = $cat[0];
echo '';
echo get_category_parents($cat, TRUE, '');
echo '';
echo ''. get_the_title() .'';
} }
elseif ( is_page() && $post->post_parent ) {
$parent_id = $post->post_parent;
$breadcrumbs = array();
while ($parent_id) {
$page = get_page($parent_id);
$breadcrumbs[] = '' . get_the_title($page->ID) . '';
$parent_id = $page->post_parent;
}
$breadcrumbs = array_reverse($breadcrumbs);
foreach ($breadcrumbs as $crumb) echo $crumb;
echo ''. get_the_title() .'';
}
elseif( is_search() )
{
echo ''. get_search_query() .'';
}
elseif( is_404() )
{
echo ''.__('Error 404','atua').'';
}
else {
echo ''. get_the_title() .'';
}
endif;
}
endif;
/*=========================================
Register Google fonts for Atua.
=========================================*/
function atua_google_fonts_url() {
$font_families = array('DM+Sans:wght@400;500;700&family=Red+Hat+Display:wght@400;500;600;700;800;900');
$fonts_url = add_query_arg( array(
'family' => implode( '&family=', $font_families ),
'display' => 'swap',
), 'https://fonts.googleapis.com/css2' );
require_once get_theme_file_path( 'inc/wptt-webfont-loader.php' );
return wptt_get_webfont_url( esc_url_raw( $fonts_url ) );
}
function atua_google_fonts_scripts_styles() {
wp_enqueue_style( 'atua-google-fonts', atua_google_fonts_url(), array(), null );
}
add_action( 'wp_enqueue_scripts', 'atua_google_fonts_scripts_styles' );
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes Classes for the body element.
* @return array
*/
function atua_body_classes( $classes ) {
// Adds a class of group-blog to blogs with more than 1 published author.
if ( is_multi_author() ) {
$classes[] = 'group-blog';
}
// Adds a class of hfeed to non-singular pages.
if ( ! is_singular() ) {
$classes[] = 'hfeed';
}
return $classes;
}
add_filter( 'body_class', 'atua_body_classes' );
if ( ! function_exists( 'wp_body_open' ) ) {
/**
* Backward compatibility for wp_body_open hook.
*
* @since 1.0.0
*/
function wp_body_open() {
do_action( 'wp_body_open' );
}
}
if (!function_exists('atua_str_replace_assoc')) {
/**
* atua_str_replace_assoc
* @param array $replace
* @param array $subject
* @return array
*/
function atua_str_replace_assoc(array $replace, $subject) {
return str_replace(array_keys($replace), array_values($replace), $subject);
}
}
/*=========================================
Atua Site Preloader
=========================================*/
if ( ! function_exists( 'atua_site_preloader' ) ) :
function atua_site_preloader() {
$atua_hs_preloader_option = get_theme_mod( 'atua_hs_preloader_option','1');
if($atua_hs_preloader_option == '1') {
?>
%1$s', 'atua'),$str);
}
?>
'primary_menu',
'container' => '',
'menu_class' => 'dt_navbar-mainmenu',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker()
)
);
}
endif;
add_action( 'atua_site_header_navigation', 'atua_site_header_navigation' );
/*=========================================
Atua Header Button
=========================================*/
if ( ! function_exists( 'atua_header_button' ) ) :
function atua_header_button() {
$atua_hs_hdr_btn = get_theme_mod( 'atua_hs_hdr_btn','1');
$atua_hdr_btn_lbl = get_theme_mod( 'atua_hdr_btn_lbl');
$atua_hdr_btn_link = get_theme_mod( 'atua_hdr_btn_link');
$atua_hdr_btn_target = get_theme_mod( 'atua_hdr_btn_target');
if($atua_hdr_btn_target=='1'): $target='target=_blank'; else: $target=''; endif;
if($atua_hs_hdr_btn=='1' && !empty($atua_hdr_btn_lbl)):
?>
class="dt-btn dt-btn-primary">
cart->cart_contents_count;
if ( $count > 0 ) {
?>
cart->cart_contents_count;
?>
cart->cart_contents_count;
if ( $count > 0 ) {
?>
date_i18n('Y'),
'[site_title]' => get_bloginfo('name'),
'[theme_author]' => sprintf(__('Desert Themes', 'atua')),
);
?>