function child_theme_dynamicnews_css_layout() { // Get Theme Options from Database $theme_options = dynamicnews_theme_options(); // Change Layout to wide if activated if (isset($theme_options['layout']) and $theme_options['layout'] == 'wide') { echo '<style type="text/css"> @media only screen and (min-width: 60em) { #wrapper { margin: 0; width: 100%; max-width: 100%; background: none; } #header { } .container { max-width: 1340px; width: 92%; margin: 0 auto; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } #wrap { padding: 1.5em 0; } } @media only screen and (max-width: 70em) { .container { width: 94%; } } @media only screen and (max-width: 65em) { .container { width: 96%; } #wrapper { background: #fff; } } @media only screen and (max-width: 60em) { .container { width: 100%; margin: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } #wrap { padding: 1.5em 1.5em 0; } } </style>'; } }
function dynamicnews_excerpt_more($more) { // Get Theme Options from Database $theme_options = dynamicnews_theme_options(); // Return Excerpt Text if (isset($theme_options['excerpt_text']) and $theme_options['excerpt_text'] == true) { return ' [...]'; } else { return ''; } }
function dynamicnews_custom_jscript_slider() { // Get Theme Options from Database $theme_options = dynamicnews_theme_options(); // Set Parameters array $params = array(); // Define Slider Animation if (isset($theme_options['slider_animation'])) { $params['animation'] = esc_attr($theme_options['slider_animation']); } // Passing Parameters to Javascript wp_localize_script('dynamicnewslite-jquery-frontpage_slider', 'dynamicnews_slider_params', $params); }
function dynamicnews_fonts_url() { $fonts_url = ''; // Get Theme Options from Database $theme_options = dynamicnews_theme_options(); // Only embed Google Fonts if not deactivated if (!(isset($theme_options['deactivate_google_fonts']) and $theme_options['deactivate_google_fonts'] == true)) { // Set Default Fonts $font_families = array('Droid Sans:400,700', 'Francois One'); // Set Google Font Query Args $query_args = array('family' => urlencode(implode('|', $font_families)), 'subset' => urlencode('latin,latin-ext')); // Create Fonts URL $fonts_url = add_query_arg($query_args, '//fonts.googleapis.com/css'); } return apply_filters('dynamicnews_google_fonts_url', $fonts_url); }
function dynamicnews_display_post_navigation() { // Get Theme Options from Database $theme_options = dynamicnews_theme_options(); if (true == $theme_options['post_navigation']) { the_post_navigation(array('prev_text' => '« %title', 'next_text' => '%title »')); } }
<?php get_header(); ?> <?php // Get Theme Options from Database $theme_options = dynamicnews_theme_options(); ?> <div id="wrap" class="container clearfix"> <section id="content" class="primary" role="main"> <?php if (have_posts()) { ?> <h2 id="search-title" class="archive-title"> <?php printf(__('Search Results for: %s', 'dynamicnewslite'), '<span>' . get_search_query() . '</span>'); ?> </h2> <?php while (have_posts()) { the_post(); get_template_part('content', $theme_options['posts_length']); } dynamicnews_display_pagination(); } else { ?>
function dynamicnews_display_postinfo_single() { // Get Theme Options from Database $theme_options = dynamicnews_theme_options(); // Display Date unless user has deactivated it via settings if (isset($theme_options['meta_tags']) and $theme_options['meta_tags'] == true) { $tag_list = get_the_tag_list('', ', '); if ($tag_list) { ?> <span class="meta-tags"> <?php printf(__('tagged with %1$s', 'dynamic-news-lite'), $tag_list); ?> </span> <?php } } // Display Categories dynamicnews_display_postinfo_index(); }
function dynamicnews_display_thumbnail_single() { // Get Theme Options from Database $theme_options = dynamicnews_theme_options(); // Display Post Thumbnail if activated if (isset($theme_options['post_thumbnails_single']) and $theme_options['post_thumbnails_single'] == true) { the_post_thumbnail('featured_image'); } }
function dynamicnews_css_layout() { // Get Theme Options from Database $theme_options = dynamicnews_theme_options(); // Change Layout to wide if activated if (isset($theme_options['layout']) and $theme_options['layout'] == 'wide') { echo '<style type="text/css"> @media only screen and (min-width: 60em) { #wrapper { margin: 0; width: 100%; max-width: 100%; background: none; } #header { padding: 3em 0.5em; } .container { max-width: 1340px; width: 92%; margin: 0 auto; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } #wrap { padding: 1.5em 0; } } @media only screen and (max-width: 70em) { .container { width: 94%; } } @media only screen and (max-width: 65em) { .container { width: 96%; } #wrapper { background: #fff; } } @media only screen and (max-width: 60em) { .container { width: 100%; margin: 0; -webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box; } #wrap { padding: 1.5em 1.5em 0; } } </style>'; } // Switch Sidebar to left if (isset($theme_options['sidebar']) and $theme_options['sidebar'] == 'left-sidebar') { echo '<style type="text/css"> @media only screen and (min-width: 60em) { #content { float: right; padding-right: 0; padding-left: 1.5em; } #sidebar { float: left; } } </style>'; } }