public function custom_css() { echo '<!-- Custom CSS --> <style type="text/css">'; echo dt_get_theme_option('custom-css', ''); echo '</style> <!-- end custom css -->'; }
<?php /** * The template part for displaying content * * @subpackage Dawn */ $layout = dt_get_theme_option('blog-layout', 'full-width'); $show_readmore = dt_get_theme_option('blogs-show-readmore', '') == '1' ? 'yes' : ''; // Define post layout $post_col = 'col-md-4 col-sm-6'; // full-width if ($layout == 'right-sidebar' || $layout == 'left-sidebar') { $post_col = 'col-md-12 col-sm-6'; } ?> <article id="post-<?php the_ID(); ?> " <?php post_class($post_col); ?> itemscope=""> <?php if (has_post_thumbnail()) { ?> <div class="post-thumbnail"> <a href="<?php echo get_permalink();
function dt_page_title($echo = true) { $title = ""; if (is_category()) { $title = single_cat_title('', false); } elseif (is_day()) { $title = esc_html_e('Archive for date:', 'ticketbox') . " " . get_the_time('F jS, Y'); } elseif (is_month()) { $title = esc_html_e('Archive for month:', 'ticketbox') . " " . get_the_time('F, Y'); } elseif (is_year()) { $title = esc_html_e('Archive for year:', 'ticketbox') . " " . get_the_time('Y'); } elseif (is_search()) { global $wp_query; if (!empty($wp_query->found_posts)) { if ($wp_query->found_posts > 1) { $title = $wp_query->found_posts . " " . esc_html_e('search results for', 'ticketbox') . ' <span class="search-query">' . esc_attr(get_search_query()) . '</span>'; } else { $title = $wp_query->found_posts . " " . esc_html_e('search result for', 'ticketbox') . ' <span class="search-query">' . esc_attr(get_search_query()) . '</span>'; } } else { if (!empty($_GET['s'])) { $title = esc_html_e('Search results for', 'ticketbox') . ' <span class="search-query">' . esc_attr(get_search_query()) . '</span>'; } else { $title = esc_html_e('To search the site please enter a valid term', 'ticketbox'); } } } elseif (is_author()) { $curauth = get_query_var('author_name') ? get_user_by('slug', get_query_var('author_name')) : get_userdata(get_query_var('author')); if (isset($curauth->nickname)) { $title = $curauth->nickname; } } elseif (is_tag()) { $title = single_tag_title('', false); } elseif (is_tax()) { $term = get_term_by('slug', get_query_var('term'), get_query_var('taxonomy')); $title = $term->name; } elseif (is_front_page() && !is_home()) { $title = get_the_title(get_option('page_on_front')); } elseif (is_home() && !is_front_page()) { $title = get_the_title(get_option('page_for_posts')); } elseif (is_404()) { $title = esc_html_e('404 - Page not found', 'ticketbox'); } else { $title = get_the_title(); } if (isset($_GET['paged']) && !empty($_GET['paged'])) { $title .= " (" . esc_html_e('Page', 'ticketbox') . " " . $_GET['paged'] . ")"; } if (defined('WOOCOMMERCE_VERSION') && is_woocommerce() && (is_product() || is_shop()) && !is_search()) { // if( ! is_product() ) { // $title = woocommerce_page_title( false ); // }else{ // $title = // } $title = woocommerce_page_title(false); } if (is_post_type_archive('portfolio')) { $title = esc_html(dt_get_theme_option('portfolio-archive-title', esc_html_e('My Portfolio', 'ticketbox'))); } if ($echo) { echo dt_echo($title); } else { return $title; } }
/** * Extend the default WordPress body classes. * * Adds body classes to denote: * 1. Single or multiple authors. * 2. Presence of header image except in Multisite signup and activate pages. * 3. Index views. * 4. Full-width content layout. * 5. Presence of footer widgets. * 6. Single views. * 7. Featured content layout. * * @param array $classes A list of existing body class values. * @return array The filtered body class list. */ function dawn_body_classes($classes) { if (is_multi_author()) { $classes[] = 'group-blog'; } if (get_header_image()) { $classes[] = 'header-image'; } elseif (!in_array($GLOBALS['pagenow'], array('wp-activate.php', 'wp-signup.php'))) { $classes[] = 'masthead-fixed'; } if (is_archive() || is_search() || is_home()) { $classes[] = 'dawn-posts-list list-view'; } if (!is_active_sidebar('sidebar-2') || is_page_template('page-templates/full-width.php') || is_page_template('page-templates/front-page.php') || is_attachment()) { $classes[] = 'full-width'; } if (is_active_sidebar('sidebar-3')) { $classes[] = 'footer-widgets'; } if (is_singular() && !is_front_page()) { $classes[] = 'singular'; } // Sticky menu if (dt_get_theme_option('sticky-menu', '1') == '1') { $classes[] = 'sticky-menu'; } return $classes; }
<div id="page" class="hfeed site"> <div class="offcanvas-overlay"></div> <header id="header" class="site-header <?php echo esc_attr($is_sticky_menu); ?> " role="banner"> <div class="container"> <div class="header-main"> <div class="header-left"> <span class="menu-toggle"><i class="fa fa-bars"></i></span> <h1 class="site-title"><a href="<?php echo esc_url(home_url('/')); ?> " rel="home"><img class="logo" src="<?php echo dt_get_theme_option('logo', ''); ?> "/></a></h1> </div> <div class="header-right"> <nav id="primary-navigation" class="site-navigation primary-navigation" role="navigation"> <?php wp_nav_menu(array('theme_location' => 'primary', 'menu_class' => 'nav-menu', 'menu_id' => 'primary-menu')); ?> </nav> </div> </div> </div> </header><!-- #header -->
</div> </div><!-- #footer-sidebar --> </div><!-- #supplementary --> <?php } ?> <div class="copyright-section"> <div class="container"> <div class="row"> <div class="col-md-6"> <div class="site-info"> <?php do_action('dawn_credits'); ?> <span><?php echo dt_get_theme_option('footer-copyright', ''); ?> </a> </div><!-- .site-info --> </div> <div class="col-md-6"> <?php if (has_nav_menu('secondary')) { ?> <nav role="navigation" class="navigation footer-navigation"> <?php wp_nav_menu(array('theme_location' => 'secondary', 'depth' => 1)); ?> </nav><!-- .Footer menu --> <?php }
/** * Mailchimp subscribe */ protected function _mailchimp_subscribe() { $mailchimp_api = dt_get_theme_option('mailchimp_api', false); $success = -1; $message = ''; $_POST = stripslashes_deep($_POST); $_REQUEST = stripslashes_deep($_REQUEST); $_GET = stripslashes_deep($_GET); $data = $_REQUEST; $nonce = $_REQUEST['_subscribe_nonce']; if (!wp_verify_nonce($nonce, 'mailchimp_subscribe_nonce')) { wp_die(esc_html__('Verify Nonce Failed', 'dawnthemes')); } if (!filter_var(@$data['email'], FILTER_VALIDATE_EMAIL)) { wp_die(esc_html__('Invalid Email', 'dawnthemes')); } if ($mailchimp_api) { if (!class_exists('MCAPI')) { include_once DTINC_DIR . '/lib/MCAPI.class.php'; } $api = new MCAPI($mailchimp_api); $list_id = dt_get_theme_option('mailchimp_list', 0); $first_name = isset($data['first_name']) ? $data['first_name'] : (isset($data['name']) ? $data['name'] : ''); $last_name = isset($data['last_name']) ? $data['last_name'] : (isset($data['name']) ? $data['name'] : ''); $email_address = isset($data['email']) ? $data['email'] : ''; $merge_vars = array('FNAME' => $first_name, 'LNAME' => $last_name); $mailchimp_group_name = dt_get_theme_option('mailchimp_group_name', ''); $mailchimp_group = dt_get_theme_option('mailchimp_group', ''); if (!empty($mailchimp_group) && !empty($mailchimp_group_name)) { $merge_vars['GROUPINGS'] = array(array('name' => $mailchimp_group_name, 'groups' => $mailchimp_group)); } $double_optin = dt_get_theme_option('mailchimp_opt_in', '') === '1' ? true : false; $replace_interests = dt_get_theme_option('mailchimp_replace_interests', '') === '1' ? true : false; $send_welcome = dt_get_theme_option('mailchimp_welcome_email', '') === '1' ? true : false; try { $retval = $api->listSubscribe($list_id, $email_address, $merge_vars, $email_type = 'html', $double_optin, false, $replace_interests, $send_welcome); if ($retval) { $success = 1; } } catch (Exception $e) { if ($e->getCode() == 214) { $success = 1; } else { $message = $e->getMessage(); } } } $return = esc_url_raw(add_query_arg('mailchimp_subscribe', $success, wp_get_referer())); wp_safe_redirect($return); die; }