Browse Source

Init

master
Walter Hupfeld 2 years ago
commit
dce5c98d2c
  1. 2
      README.md
  2. 46
      footer.php
  3. 65
      functions.php
  4. 618
      inc/extras.php
  5. BIN
      screenshot.png
  6. 77
      sektorblog.php
  7. 35
      sidebar.php
  8. 45
      single.php
  9. 78
      singleblog.php
  10. 5158
      style.css
  11. 68
      template-parts/content-page.php
  12. 112
      template-parts/content-single.php
  13. 97
      template-parts/content.php

2
README.md

@ -0,0 +1,2 @@
# SPARKLING Child Theme

46
footer.php

@ -0,0 +1,46 @@
<?php
/**
* The template for displaying the footer.
*
* Contains the closing of the #content div and all content after
*
* @package sparkling
*/
?>
</div><!-- close .row -->
</div><!-- close .container -->
</div><!-- close .site-content -->
<div id="footer-area">
<div class="container footer-inner">
<div class="row">
<?php get_sidebar( 'footer' ); ?>
</div>
</div>
<footer id="colophon" class="site-footer" role="contentinfo">
<div class="site-info container">
<div class="row">
<nav role="navigation" class="col-md-12">
<?php sparkling_footer_links(); ?>
<?php
if ( of_get_option( 'footer_social' ) ) {
sparkling_social_icons();}
?>
</nav>
<div class="copyright col-md-6">
<?php //echo of_get_option( 'custom_footer_text', 'sparkling' ); ?>
<?php //sparkling_footer_info(); ?>
</div>
</div>
</div><!-- .site-info -->
<div class="scroll-to-top"><i class="fa fa-angle-up"></i></div><!-- .scroll-to-top -->
</footer><!-- #colophon -->
</div>
</div><!-- #page -->
<?php wp_footer(); ?>
</body>
</html>

65
functions.php

@ -0,0 +1,65 @@
<?php
/**
* Child theme stylesheet einbinden in Abhängigkeit vom Original-Stylesheet
*/
function child_theme_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-theme-css', get_stylesheet_directory_uri() .'/style.css' , array('parent-style'));
}
add_action( 'wp_enqueue_scripts', 'child_theme_styles' );
/*
function sparkling_archive_pages_title( $title ) {
if ( is_tag() ) {
$template = of_get_option( 'tag_title' );
if ( empty( $template ) ) {
return $title;
} else {
return sprintf( $template, single_tag_title( '', false ) );
}
} elseif ( is_category() ) {
$template = of_get_option( 'category_title' );
if ( empty( $template ) ) {
return $title;
} else {
return sprintf( $template, single_cat_title( '', false ) );
}
} elseif ( is_author() ) {
$template = of_get_option( 'author_title' );
if ( empty( $template ) ) {
return $title;
} else {
return sprintf( $template, get_the_author() );
}
} elseif ( is_year() ) {
$template = of_get_option( 'year_title' );
if ( empty( $template ) ) {
return $title;
} else {
return sprintf( $template, get_the_date( _x( 'Y', 'yearly archives date format', 'sparkling' ) ) );
}
} elseif ( is_month() ) {
$template = of_get_option( 'month_title' );
if ( empty( $template ) ) {
return $title;
} else {
return sprintf( $template, get_the_date( _x( 'F Y', 'monthly archives date format', 'sparkling' ) ) );
}
} elseif ( is_day() ) {
$template = of_get_option( 'day_title' );
if ( empty( $template ) ) {
return $title;
} else {
return sprintf( $template, get_the_date( _x( 'F j, Y', 'daily archives date format', 'sparkling' ) ) );
}
} else {
return $title;
}
}
//add_filter( 'get_the_archive_title', 'sparkling_archive_pages_title' );
*/

618
inc/extras.php

@ -0,0 +1,618 @@
<?php
/**
* Custom functions that act independently of the theme templates
*
* Eventually, some of the functionality here could be replaced by core features
*
* @package sparkling
*/
/**
* Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
*
* @param array $args Configuration arguments.
*
* @return array
*/
function sparkling_page_menu_args( $args ) {
$args['show_home'] = true;
return $args;
}
add_filter( 'wp_page_menu_args', 'sparkling_page_menu_args' );
/**
* Adds custom classes to the array of body classes.
*
* @param array $classes Classes for the body element.
*
* @return array
*/
function sparkling_body_classes( $classes ) {
// Adds a class of group-blog to blogs with more than 1 published author.
if ( is_multi_author() ) {
$classes[] = 'group-blog';
}
return $classes;
}
add_filter( 'body_class', 'sparkling_body_classes' );
// Mark Posts/Pages as Untiled when no title is used
add_filter( 'the_title', 'sparkling_title' );
function sparkling_title( $title ) {
if ( '' == $title ) {
return 'Untitled';
} else {
return $title;
}
}
/**
* Password protected post form using Boostrap classes
*/
add_filter( 'the_password_form', 'custom_password_form' );
function custom_password_form() {
global $post;
$label = 'pwbox-' . ( empty( $post->ID ) ? rand() : $post->ID );
$o = '<form class="protected-post-form" action="' . get_option( 'siteurl' ) . '/wp-login.php?action=postpass" method="post">
<div class="row">
<div class="col-lg-10">
<p>' . esc_html__( 'This post is password protected. To view it please enter your password below:', 'sparkling' ) . '</p>
<label for="' . $label . '">' . esc_html__( 'Password:', 'sparkling' ) . ' </label>
<div class="input-group">
<input class="form-control" value="' . get_search_query() . '" name="post_password" id="' . $label . '" type="password">
<span class="input-group-btn"><button type="submit" class="btn btn-default" name="submit" id="searchsubmit" value="' . esc_attr__( 'Submit', 'sparkling' ) . '">' . esc_html__( 'Submit', 'sparkling' ) . '</button>
</span>
</div>
</div>
</div>
</form>';
return $o;
}
// Add Bootstrap classes for table
add_filter( 'the_content', 'sparkling_add_custom_table_class' );
function sparkling_add_custom_table_class( $content ) {
return preg_replace( '/(<table) ?(([^>]*)class="([^"]*)")?/', '$1 $3 class="$4 table table-hover" ', $content );
}
if ( ! function_exists( 'sparkling_social_icons' ) ) :
/**
* Display social links in footer and widgets
*
* @package sparkling
*/
function sparkling_social_icons() {
if ( has_nav_menu( 'social-menu' ) ) {
wp_nav_menu(
array(
'theme_location' => 'social-menu',
'container' => 'nav',
'container_id' => 'menu-social',
'container_class' => 'social-icons',
'menu_id' => 'menu-social-items',
'menu_class' => 'social-menu',
'depth' => 1,
'fallback_cb' => '',
'link_before' => '<i class="social_icon"><span>',
'link_after' => '</span></i>',
)
);
}
}
endif;
if ( ! function_exists( 'sparkling_header_menu' ) ) :
/**
* Header menu (should you choose to use one)
*/
function sparkling_header_menu() {
// display the WordPress Custom Menu if available
wp_nav_menu(
array(
'menu' => 'primary',
'theme_location' => 'primary',
'container' => 'div',
'container_class' => 'collapse navbar-collapse navbar-ex1-collapse',
'menu_class' => 'nav navbar-nav',
'fallback_cb' => 'WP_Bootstrap_Navwalker::fallback',
'walker' => new WP_Bootstrap_Navwalker(),
)
);
} /* end header menu */
endif;
if ( ! function_exists( 'sparkling_footer_links' ) ) :
/**
* Footer menu (should you choose to use one)
*/
function sparkling_footer_links() {
// display the WordPress Custom Menu if available
wp_nav_menu(
array(
'container' => '', // remove nav container
'container_class' => 'footer-links clearfix', // class of container (should you choose to use it)
'menu' => esc_html__( 'Footer Links', 'sparkling' ), // nav name
'menu_class' => 'nav footer-nav clearfix', // adding custom nav class
'theme_location' => 'footer-links', // where it's located in the theme
'before' => '', // before the menu
'after' => '', // after the menu
'link_before' => '', // before each link
'link_after' => '', // after each link
'fallback_cb' => 'sparkling_footer_links_fallback', // fallback function
)
);
} /* end sparkling footer link */
endif;
if ( ! function_exists( 'sparkling_call_for_action' ) ) :
/**
* Call for action text and button displayed above content
*/
function sparkling_call_for_action() {
if ( is_front_page() && of_get_option( 'w2f_cfa_text' ) != '' ) {
echo '<div class="cfa">';
echo '<div class="container">';
echo '<div class="col-sm-8">';
echo '<span class="cfa-text">' . of_get_option( 'w2f_cfa_text' ) . '</span>';
echo '</div>';
echo '<div class="col-sm-4">';
echo '<a class="btn btn-lg cfa-button" href="' . of_get_option( 'w2f_cfa_link' ) . '">' . of_get_option( 'w2f_cfa_button' ) . '</a>';
echo '</div>';
echo '</div>';
echo '</div>';
}
}
endif;
if ( ! function_exists( 'sparkling_featured_slider' ) ) :
/**
* Featured image slider, displayed on front page for static page and blog
*/
function sparkling_featured_slider() {
if ( is_front_page() && of_get_option( 'sparkling_slider_checkbox' ) == 1 ) {
echo '<div class="flexslider">';
echo '<ul class="slides">';
$count = of_get_option( 'sparkling_slide_number' );
$slidecat = of_get_option( 'sparkling_slide_categories' );
$query = new WP_Query(
array(
'cat' => 194,
'posts_per_page' => $count,
'meta_query' => array(
array(
'key' => '_thumbnail_id',
'compare' => 'EXISTS',
),
),
)
);
if ( $query->have_posts() ) :
while ( $query->have_posts() ) :
$query->the_post();
if ( of_get_option( 'sparkling_slider_link_checkbox', 1 ) == 1 ) {
echo '<li><a href="' . get_permalink() . '">';
} else {
echo '<li>';
}
if ( ( function_exists( 'has_post_thumbnail' ) ) && ( has_post_thumbnail() ) ) :
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
$feat_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
$args = array(
'resize' => '1920,550',
);
$photon_url = jetpack_photon_url( $feat_image_url[0], $args );
echo '<img src="' . $photon_url . '">';
} else {
echo get_the_post_thumbnail( get_the_ID(), 'activello-slider' );
}
endif;
echo '<div class="flex-caption">';
if ( get_the_title() != '' ) {
echo '<h2 class="entry-title">' . get_the_title() . '</h2>';
}
if ( get_the_excerpt() != '' ) {
echo '<div class="excerpt">' . get_the_excerpt() . '</div>';
}
echo '</div>';
echo '</a></li>';
endwhile;
endif;
wp_reset_postdata();
$query = new WP_Query(
array(
'cat' => $slidecat,
'posts_per_page' => $count,
'meta_query' => array(
array(
'key' => '_thumbnail_id',
'compare' => 'EXISTS',
),
),
)
);
if ( $query->have_posts() ) :
while ( $query->have_posts() ) :
$query->the_post();
if ( of_get_option( 'sparkling_slider_link_checkbox', 1 ) == 1 ) {
echo '<li><a href="' . get_permalink() . '">';
} else {
echo '<li>';
}
if ( ( function_exists( 'has_post_thumbnail' ) ) && ( has_post_thumbnail() ) ) :
if ( class_exists( 'Jetpack' ) && Jetpack::is_module_active( 'photon' ) ) {
$feat_image_url = wp_get_attachment_image_src( get_post_thumbnail_id(), 'full' );
$args = array(
'resize' => '1920,550',
);
$photon_url = jetpack_photon_url( $feat_image_url[0], $args );
echo '<img src="' . $photon_url . '">';
} else {
echo get_the_post_thumbnail( get_the_ID(), 'activello-slider' );
}
endif;
echo '<div class="flex-caption">';
if ( get_the_title() != '' ) {
echo '<h2 class="entry-title">' . get_the_title() . '</h2>';
}
if ( get_the_excerpt() != '' ) {
echo '<div class="excerpt">' . get_the_excerpt() . '</div>';
}
echo '</div>';
echo '</a></li>';
endwhile;
endif;
wp_reset_postdata();
echo '</ul>';
echo ' </div>';
}// End if().
}
endif;
/**
* function to show the footer info, copyright information
*/
function sparkling_footer_info() {
global $sparkling_footer_info;
printf( esc_html__( 'Theme by %1$s Powered by %2$s', 'sparkling' ), '<a href="http://colorlib.com/" target="_blank">Colorlib</a>', '<a href="http://wordpress.org/" target="_blank">WordPress</a>' );
}
if ( ! function_exists( 'get_sparkling_theme_options' ) ) {
/**
* Get information from Theme Options and add it into wp_head
*/
function get_sparkling_theme_options() {
echo '<style type="text/css">';
if ( of_get_option( 'link_color' ) ) {
echo 'a, #infinite-handle span, #secondary .widget .post-content a, .entry-meta a {color:' . of_get_option( 'link_color' ) . '}';
}
if ( of_get_option( 'link_hover_color' ) ) {
echo 'a:hover, a:active, #secondary .widget .post-content a:hover,
.woocommerce nav.woocommerce-pagination ul li a:focus, .woocommerce nav.woocommerce-pagination ul li a:hover,
.woocommerce nav.woocommerce-pagination ul li span.current, #secondary .widget a:hover {color: ' . of_get_option( 'link_hover_color' ) . ';}';
}
if ( of_get_option( 'element_color' ) ) {
echo '.btn-default, .label-default, .flex-caption h2, .btn.btn-default.read-more,button,
.navigation .wp-pagenavi-pagination span.current,.navigation .wp-pagenavi-pagination a:hover,
.woocommerce a.button, .woocommerce button.button,
.woocommerce input.button, .woocommerce #respond input#submit.alt,
.woocommerce a.button, .woocommerce button.button,
.woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt { background-color: ' . of_get_option( 'element_color' ) . '; border-color: ' . of_get_option( 'element_color' ) . ';}';
echo '.site-main [class*="navigation"] a, .more-link, .pagination>li>a, .pagination>li>span, .cfa-button { color: ' . of_get_option( 'element_color' ) . '}';
echo '.cfa-button {border-color: ' . of_get_option( 'element_color' ) . ';}';
}
if ( of_get_option( 'element_color_hover' ) ) {
echo '.btn-default:hover, .label-default[href]:hover, .tagcloud a:hover,button, .main-content [class*="navigation"] a:hover,.label-default[href]:focus, #infinite-handle span:hover,.btn.btn-default.read-more:hover, .btn-default:hover, .scroll-to-top:hover, .btn-default:focus, .btn-default:active, .btn-default.active, .site-main [class*="navigation"] a:hover, .more-link:hover, #image-navigation .nav-previous a:hover, #image-navigation .nav-next a:hover, .cfa-button:hover,.woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover, .woocommerce #respond input#submit.alt:hover, .woocommerce a.button:hover, .woocommerce button.button:hover, .woocommerce input.button:hover,.woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover, .woocommerce input.button.alt:hover, a:hover .flex-caption h2 { background-color: ' . of_get_option( 'element_color_hover' ) . '; border-color: ' . of_get_option( 'element_color_hover' ) . '; }';
}
if ( of_get_option( 'element_color_hover' ) ) {
echo '.pagination>li>a:focus, .pagination>li>a:hover, .pagination>li>span:focus, .pagination>li>span:hover {color: ' . of_get_option( 'element_color_hover' ) . ';}';
}
if ( of_get_option( 'cfa_bg_color' ) ) {
echo '.cfa { background-color: ' . of_get_option( 'cfa_bg_color' ) . '; } .cfa-button:hover a {color: ' . of_get_option( 'cfa_bg_color' ) . ';}';
}
if ( of_get_option( 'cfa_color' ) ) {
echo '.cfa-text { color: ' . of_get_option( 'cfa_color' ) . ';}';
}
if ( of_get_option( 'cfa_btn_color' ) || of_get_option( 'cfa_btn_txt_color' ) ) {
echo '.cfa-button {border-color: ' . of_get_option( 'cfa_btn_color' ) . '; color: ' . of_get_option( 'cfa_btn_txt_color' ) . ';}';
}
if ( of_get_option( 'heading_color' ) ) {
echo 'h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .entry-title, .entry-title a {color: ' . of_get_option( 'heading_color' ) . ';}';
}
if ( of_get_option( 'nav_bg_color' ) ) {
echo '.navbar.navbar-default, .navbar-default .navbar-nav .open .dropdown-menu > li > a {background-color: ' . of_get_option( 'nav_bg_color' ) . ';}';
}
if ( of_get_option( 'nav_link_color' ) ) {
echo '.navbar-default .navbar-nav > li > a, .navbar-default .navbar-nav.sparkling-mobile-menu > li:hover > a, .navbar-default .navbar-nav.sparkling-mobile-menu > li:hover > .caret, .navbar-default .navbar-nav > li, .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus { color: ' . of_get_option( 'nav_link_color' ) . ';}';
echo '@media (max-width: 767px){ .navbar-default .navbar-nav > li:hover > a, .navbar-default .navbar-nav > li:hover > .caret{ color: ' . of_get_option( 'nav_link_color' ) . '!important ;} }';
}
if ( of_get_option( 'nav_item_hover_color' ) ) {
echo '.navbar-default .navbar-nav > li:hover > a, .navbar-nav > li:hover > .caret, .navbar-default .navbar-nav.sparkling-mobile-menu > li.open > a, .navbar-default .navbar-nav.sparkling-mobile-menu > li.open > .caret, .navbar-default .navbar-nav > li:hover, .navbar-default .navbar-nav > .active > a, .navbar-default .navbar-nav > .active > .caret, .navbar-default .navbar-nav > .active > a:hover, .navbar-default .navbar-nav > .active > a:focus, .navbar-default .navbar-nav > li > a:hover, .navbar-default .navbar-nav > li > a:focus, .navbar-default .navbar-nav > .open > a, .navbar-default .navbar-nav > .open > a:hover, .navbar-default .navbar-nav > .open > a:focus {color: ' . of_get_option( 'nav_item_hover_color' ) . ';}';
echo '@media (max-width: 767px){ .navbar-default .navbar-nav > li.open > a, .navbar-default .navbar-nav > li.open > .caret { color: ' . of_get_option( 'nav_item_hover_color' ) . ' !important; } }';
}
if ( of_get_option( 'nav_dropdown_bg' ) ) {
echo '.dropdown-menu {background-color: ' . of_get_option( 'nav_dropdown_bg' ) . ';}';
}
if ( of_get_option( 'nav_dropdown_item' ) ) {
echo '.navbar-default .navbar-nav .open .dropdown-menu > li > a, .dropdown-menu > li > a, .dropdown-menu > li > .caret { color: ' . of_get_option( 'nav_dropdown_item' ) . ';}';
}
if ( of_get_option( 'nav_dropdown_bg_hover' ) ) {
echo '.navbar-default .navbar-nav .dropdown-menu > li:hover, .navbar-default .navbar-nav .dropdown-menu > li:focus, .dropdown-menu > .active {background-color: ' . of_get_option( 'nav_dropdown_bg_hover' ) . ';}';
echo '@media (max-width: 767px) {.navbar-default .navbar-nav .dropdown-menu > li:hover, .navbar-default .navbar-nav .dropdown-menu > li:focus, .dropdown-menu > .active {background: transparent;} }';
}
if ( of_get_option( 'nav_dropdown_item_hover' ) ) {
echo '.dropdown-menu>.active>a, .dropdown-menu>.active>a:focus, .dropdown-menu>.active>a:hover, .dropdown-menu>.active>.caret, .dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover, .dropdown-menu>li:hover>a, .dropdown-menu>li:hover>.caret {color:' . of_get_option( 'nav_dropdown_item_hover' ) . ';}';
echo '@media (max-width: 767px) {.navbar-default .navbar-nav .open .dropdown-menu > .active > a, .navbar-default .navbar-nav .dropdown-menu > li.active > .caret, .navbar-default .navbar-nav .dropdown-menu > li.open > a, .navbar-default .navbar-nav li.open > a, .navbar-default .navbar-nav li.open > .caret {color:' . of_get_option( 'nav_dropdown_item_hover' ) . ';} }';
}
if ( of_get_option( 'nav_dropdown_item_hover' ) ) {
echo '.navbar-default .navbar-nav .current-menu-ancestor a.dropdown-toggle { color: ' . of_get_option( 'nav_dropdown_item_hover' ) . ';}';
}
if ( of_get_option( 'footer_bg_color' ) ) {
echo '#colophon {background-color: ' . of_get_option( 'footer_bg_color' ) . ';}';
}
if ( of_get_option( 'footer_text_color' ) ) {
echo '#footer-area, .site-info, .site-info caption, #footer-area caption {color: ' . of_get_option( 'footer_text_color' ) . ';}';
}
if ( of_get_option( 'footer_widget_bg_color' ) ) {
echo '#footer-area {background-color: ' . of_get_option( 'footer_widget_bg_color' ) . ';}';
}
if ( of_get_option( 'footer_link_color' ) ) {
echo '.site-info a, #footer-area a {color: ' . of_get_option( 'footer_link_color' ) . ';}';
}
if ( of_get_option( 'social_color' ) ) {
echo '.social-icons li a {background-color: ' . of_get_option( 'social_color' ) . ' !important ;}';
}
if ( of_get_option( 'social_footer_color' ) ) {
echo '#footer-area .social-icons li a {background-color: ' . of_get_option( 'social_footer_color' ) . ' !important ;}';
}
global $typography_options;
$typography = of_get_option( 'main_body_typography' );
if ( $typography ) {
if ( isset( $typography['color'] ) ) {
echo 'body, .entry-content {color:' . $typography['color'] . '}';
}
if ( isset( $typography['face'] ) && isset( $typography_options['faces'][ $typography['face'] ] ) ) {
echo '.entry-content {font-family: ' . $typography_options['faces'][ $typography['face'] ] . ';}';
}
if ( isset( $typography['size'] ) ) {
echo '.entry-content {font-size:' . $typography['size'] . '}';
}
if ( isset( $typography['style'] ) ) {
echo '.entry-content {font-weight:' . $typography['style'] . '}';
}
}
if ( of_get_option( 'custom_css' ) ) {
echo html_entity_decode( of_get_option( 'custom_css', 'no entry' ) );
}
echo '</style>';
}
}// End if().
add_action( 'wp_head', 'get_sparkling_theme_options', 10 );
// Theme Options sidebar
add_action( 'optionsframework_after', 'sparkling_options_display_sidebar' );
function sparkling_options_display_sidebar() {
?>
<!-- Twitter -->
<script>!function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'
if (!d.getElementById(id)) {
js = d.createElement(s)
js.id = id
js.src = p + '://platform.twitter.com/widgets.js'
fjs.parentNode.insertBefore(js, fjs)
}
}(document, 'script', 'twitter-wjs')</script>
<!-- Facebook -->
<div id="fb-root"></div>
<div id="fb-root"></div>
<script>(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0]
if (d.getElementById(id)) return
js = d.createElement(s)
js.id = id
js.src = '//connect.facebook.net/en_US/all.js#xfbml=1&appId=328285627269392'
fjs.parentNode.insertBefore(js, fjs)
}(document, 'script', 'facebook-jssdk'))</script>
<div id="optionsframework-sidebar" class="metabox-holder">
<div id="optionsframework" class="postbox">
<h3><?php esc_html_e( 'Support and Documentation', 'sparkling' ); ?></h3>
<div class="inside">
<div id="social-share">
<div class="fb-like" data-href="<?php echo esc_url( 'https://www.facebook.com/colorlib' ); ?>"
data-send="false" data-layout="button_count" data-width="90" data-show-faces="true"></div>
<div class="tw-follow"><a href="https://twitter.com/colorlib" class="twitter-follow-button"
data-show-count="false">Follow @colorlib</a></div>
</div>
<p>
<b><a href="<?php echo esc_url( 'http://colorlib.com/wp/support/sparkling' ); ?>"><?php esc_html_e( 'Sparkling Documentation', 'sparkling' ); ?></a></b>
</p>
<p><?php _e( 'The best way to contact us with <b>support questions</b> and <b>bug reports</b> is via', 'sparkling' ); ?>
<a href="<?php echo esc_url( 'http://colorlib.com/wp/forums' ); ?>"><?php esc_html_e( 'Colorlib support forum', 'sparkling' ); ?></a>.
</p>
<p><?php esc_html_e( 'If you like this theme, I\'d appreciate any of the following:', 'sparkling' ); ?></p>
<ul>
<li><a class="button"
href="<?php echo esc_url( 'http://wordpress.org/support/view/theme-reviews/sparkling?filter=5' ); ?>"
title="<?php esc_attr_e( 'Rate this Theme', 'sparkling' ); ?>"
target="_blank"><?php printf( esc_html__( 'Rate this Theme', 'sparkling' ) ); ?></a></li>
<li><a class="button" href="<?php echo esc_url( 'http://www.facebook.com/colorlib' ); ?>"
title="Like Colorlib on Facebook"
target="_blank"><?php printf( esc_html__( 'Like on Facebook', 'sparkling' ) ); ?></a></li>
<li><a class="button" href="<?php echo esc_url( 'http://twitter.com/colorlib/' ); ?>"
title="Follow Colrolib on Twitter"
target="_blank"><?php printf( esc_html__( 'Follow on Twitter', 'sparkling' ) ); ?></a></li>
</ul>
</div>
</div>
</div>
<?php
}
/**
* Add Bootstrap thumbnail styling to images with captions
* Use <figure> and <figcaption>
*
* @link http://justintadlock.com/archives/2011/07/01/captions-in-wordpress
*/
function sparkling_caption( $output, $attr, $content ) {
if ( is_feed() ) {
return $output;
}
$defaults = array(
'id' => '',
'align' => 'alignnone',
'width' => '',
'caption' => '',
);
$attr = shortcode_atts( $defaults, $attr );
// If the width is less than 1 or there is no caption, return the content wrapped between the [caption] tags
if ( $attr['width'] < 1 || empty( $attr['caption'] ) ) {
return $content;
}
// Set up the attributes for the caption <figure>
$attributes = ( ! empty( $attr['id'] ) ? ' id="' . esc_attr( $attr['id'] ) . '"' : '' );
$attributes .= ' class="thumbnail wp-caption ' . esc_attr( $attr['align'] ) . '"';
$attributes .= ' style="width: ' . ( esc_attr( $attr['width'] ) + 10 ) . 'px"';
$output = '<figure' . $attributes . '>';
$output .= do_shortcode( $content );
$output .= '<figcaption class="caption wp-caption-text">' . $attr['caption'] . '</figcaption>';
$output .= '</figure>';
return $output;
}
add_filter( 'img_caption_shortcode', 'sparkling_caption', 10, 3 );
/**
* Skype URI support for social media icons
*/
function sparkling_allow_skype_protocol( $protocols ) {
$protocols[] = 'skype';
return $protocols;
}
add_filter( 'kses_allowed_protocols', 'sparkling_allow_skype_protocol' );
/**
* Fallback option for the old Social Icons.
*/
function sparkling_social() {
if ( of_get_option( 'footer_social' ) ) {
sparkling_social_icons();
}
}
/**
* Fallback for removed sparkling_post_nav function
*/
if ( ! function_exists( 'sparkling_post_nav' ) ) {
function sparkling_post_nav() {
the_post_navigation(
array(
'next_text' => '<span class="post-title">%title <i class="fa fa-chevron-right"></i></span>',
'prev_text' => '<i class="fa fa-chevron-left"></i> <span class="post-title">%title</span>',
'in_same_term' => true,
)
);
//
}
}
/**
* Fallback for removed sparkling_paging_nav function
*/
if ( ! function_exists( 'sparkling_paging_nav' ) ) {
function sparkling_paging_nav() {
the_posts_pagination(
array(
'prev_text' => '<i class="fa fa-chevron-left"></i> ' . __( 'Newer posts', 'sparkling' ),
'next_text' => __( 'Older posts', 'sparkling' ) . ' <i class="fa fa-chevron-right"></i>',
)
);
}
}
/**
* Adds the URL to the top level navigation menu item
*/
function sparkling_add_top_level_menu_url( $atts, $item, $args ) {
if ( ! wp_is_mobile() && isset( $args->has_children ) && $args->has_children ) {
$atts['href'] = ! empty( $item->url ) ? $item->url : '';
}
return $atts;
}
add_filter( 'nav_menu_link_attributes', 'sparkling_add_top_level_menu_url', 99, 3 );
/**
* Makes the top level navigation menu item clickable
*/
function sparkling_make_top_level_menu_clickable() {
if ( ! wp_is_mobile() ) {
?>
<script type="text/javascript">
jQuery(document).ready(function ($) {
if ($(window).width() >= 767) {
$('.navbar-nav > li.menu-item > a').click(function () {
if ($(this).attr('target') !== '_blank') {
window.location = $(this).attr('href')
}
})
}
})
</script>
<?php
}
}
add_action( 'wp_footer', 'sparkling_make_top_level_menu_clickable', 1 );
/**
* Add a pingback url auto-discovery header for singularly identifiable articles.
*/
function _s_pingback_header() {
if ( is_singular() && pings_open() ) {
echo '<link rel="pingback" href="', bloginfo( 'pingback_url' ), '">';
}
}
add_action( 'wp_head', '_s_pingback_header' );

BIN
screenshot.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 482 KiB

77
sektorblog.php

@ -0,0 +1,77 @@
<?php
/**
* Template Name: Seite mit Blog (key)
*
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
?>
<?php
if(!get_query_var('paged')) {
while (have_posts()) :
the_post();
get_template_part('template-parts/content', 'page');
// If comments are open or we have at least one comment, load up the comment template
if (comments_open() || '0' != get_comments_number()) :
comments_template();
endif;
//the_post_navigation(
// array(
// 'next_text' => '<span class="post-title">%title <i class="fa fa-chevron-right"></i></span>',
// 'prev_text' => '<i class="fa fa-chevron-left"></i> <span class="post-title">%title</span>',
// )
//);
endwhile; // end of the loop.
}
?>
<?php
$args = array(
'tag' => get_query_var('pagename'),
'paged' => $paged,
'posts_per_page' => 9
);
query_posts($args);
?>
<div id="related-posts">
<?php
while ( have_posts() ) :
the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', 'content' );
endwhile;
the_posts_pagination(
array(
'prev_text' => '<i class="fa fa-chevron-left"></i> ' . __( 'Newer posts', 'sparkling' ),
'next_text' => __( 'Older posts', 'sparkling' ) . ' <i class="fa fa-chevron-right"></i>',
)
);
?>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_sidebar();
get_footer();

35
sidebar.php

@ -0,0 +1,35 @@
</div><!-- close .main-content-inner -->
<div id="secondary" class="widget-area col-sm-12 col-md-4" role="complementary">
<div class="well">
<aside id="search" class="widget widget_search">
<?php get_search_form(); ?>
</aside>
<?php do_action( 'before_sidebar' ); ?>
<?php if ( ! dynamic_sidebar( 'sidebar-1' ) ) : ?>
<aside id="archives" class="widget">
<h3 class="widget-title"><?php esc_html_e( 'Archives', 'sparkling' ); ?></h3>
<ul>
<?php
$archives_args = array(
'type' => 'monthly',
);
wp_get_archives( $archives_args );
?>
</ul>
</aside>
<aside id="meta" class="widget">
<h3 class="widget-title"><?php esc_html_e( 'Meta', 'sparkling' ); ?></h3>
<ul>
<?php wp_register(); ?>
<li><?php wp_loginout(); ?></li>
<?php wp_meta(); ?>
</ul>
</aside>
<?php endif; // end sidebar widget area ?>
</div>
</div><!-- #secondary -->

45
single.php

@ -0,0 +1,45 @@
<?php
/**
* The Template for displaying all single posts.
*
* @package sparkling
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
while ( have_posts() ) :
the_post();
get_template_part( 'template-parts/content', 'single' );
the_post_navigation(
array(
'next_text' => '<span class="post-title">%title <i class="fa fa-chevron-right"></i></span>',
'prev_text' => '<i class="fa fa-chevron-left"></i> <span class="post-title">%title</span>',
)
);
endwhile; // end of the loop.
?>
</main><!-- #main -->
</div><!-- #primary -->
<div class="commentAreas post-inner-content">
<?php
// If comments are open or we have at least one comment, load up the comment template
if ( comments_open() || '0' != get_comments_number() ) :
comments_template();
endif;
?>
</div>
<?php
get_sidebar();
get_footer();

78
singleblog.php

@ -0,0 +1,78 @@
<?php
/**
* Template Name: Seite mit Blog (cat)
*
*/
get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<?php
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
?>
<?php
if(!get_query_var('paged')) {
while (have_posts()) :
the_post();
get_template_part('template-parts/content', 'page');
// If comments are open or we have at least one comment, load up the comment template
if (comments_open() || '0' != get_comments_number()) :
comments_template();
endif;
//the_post_navigation(
// array(
// 'next_text' => '<span class="post-title">%title <i class="fa fa-chevron-right"></i></span>',
// 'prev_text' => '<i class="fa fa-chevron-left"></i> <span class="post-title">%title</span>',
// )
//);
endwhile; // end of the loop.
}
?>
<?php
//var_dump(get_query_var('pagename'));
$args = array(
'category_name' => get_query_var('pagename'),
'paged' => $paged,
'posts_per_page' => 9
);
query_posts($args);
?>
<div id="related-posts">
<?php
while ( have_posts() ) :
the_post();
/*
* Include the Post-Format-specific template for the content.
* If you want to override this in a child theme, then include a file
* called content-___.php (where ___ is the Post Format name) and that will be used instead.
*/
get_template_part( 'template-parts/content', 'content' );
endwhile;
the_posts_pagination(
array(
'prev_text' => '<i class="fa fa-chevron-left"></i> ' . __( 'Newer posts', 'sparkling' ),
'next_text' => __( 'Older posts', 'sparkling' ) . ' <i class="fa fa-chevron-right"></i>',
)
);
?>
</div>
</main><!-- #main -->
</div><!-- #primary -->
<?php
get_sidebar();
get_footer();

5158
style.css

File diff suppressed because it is too large

68
template-parts/content-page.php

@ -0,0 +1,68 @@
<?php
/**
* The template used for displaying page content in page.php
*
* @package sparkling
*/
?>
<?php
if ( is_page_template( 'page-fullwidth.php' ) ) {
the_post_thumbnail(
'sparkling-featured-fullwidth', array(
'class' => 'single-featured',
)
);
} else {
the_post_thumbnail(
'sparkling-featured', array(
'class' => 'single-featured',
)
);
}
?>
<div class="post-inner-content">
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header page-header">
<h1 class="entry-title"><?php the_title(); ?></h1>
</header><!-- .entry-header -->
<div class="entry-content">
<?php
the_content();
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'sparkling' ),
'after' => '</div>',
)
);
?>
<?php
// Checks if this is homepage to enable homepage widgets
if ( is_front_page() ) :
get_sidebar( 'home' );
endif;
?>
</div><!-- .entry-content -->
<?php if ( get_edit_post_link() ) : ?>
<footer class="entry-footer">
<?php
edit_post_link(
/*
sprintf(
/* translators: %s: Name of current post
esc_html__( 'Edit %s', 'sparkling' ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
),
*/
'<i class="fa fa-edit"></i><span class="edit-link">',
'</span>'
);
?>
</footer><!-- .entry-footer -->
<?php endif; ?>
</article><!-- #post-## -->
</div>

112
template-parts/content-single.php

@ -0,0 +1,112 @@
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
$featured_image_args = array(
'class' => 'single-featured',
);
if ( is_page_template( 'page-fullwidth.php' ) ) {
the_post_thumbnail( 'full', $featured_image_args );
} else {
the_post_thumbnail( 'full', $featured_image_args );
}
?>
<div class="post-inner-content">
<header class="entry-header page-header">
<h1 class="entry-title "><?php the_title(); ?></h1>
<div class="entry-meta">
<?php sparkling_posted_on(); ?>
<?php
/* translators: used between list items, there is a space after the comma */
$categories_list = get_the_category_list( esc_html__( ', ', 'sparkling' ) );
if ( $categories_list && sparkling_categorized_blog() ) :
?>
<!--<span class="cat-links"><i class="fa fa-folder-open"></i>
<?php //printf( esc_html__( ' %1$s', 'sparkling' ), $categories_list ); ?>
</span>
-->
<span class="cat-links"><a class="url fn n" href="<?php echo wp_get_shortlink(); ?>"><?php echo 'Kurzlink'; ?></a> </span>
<?php endif; // End if categories ?>
<?php if ( get_edit_post_link() ) : ?>
<?php
edit_post_link(
/*sprintf(
/* translators: %s: Name of current post
esc_html__( 'Edit %s', 'sparkling' ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
),*/
'<i class="fa fa-edit"></i>
<span class="edit-link">',
'</span>'
);
?>
<?php endif; ?>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<div class="entry-content">
<?php the_content(); ?>
<?php
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'sparkling' ),
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '%',
'echo' => 1,
)
);
?>
</div><!-- .entry-content -->
<footer class="entry-meta">
<?php if ( has_tag() ) : ?>
<!-- tags -->
<div class="tagcloud">
<?php
$tags = get_the_tags( get_the_ID() );
foreach ( $tags as $tag ) {
echo '<a href="' . get_tag_link( $tag->term_id ) . '">' . $tag->name . '</a> ';
}
?>
</div>
<!-- end tags -->
<?php endif; ?>
</footer><!-- .entry-meta -->
</div>
<?php if ( get_the_author_meta( 'description' ) ) : ?>
<div class="post-inner-content secondary-content-box">
<!-- author bio -->
<div class="author-bio content-box-inner">
<!-- avatar -->
<div class="avatar">
<?php echo get_avatar( get_the_author_meta( 'ID' ), '60' ); ?>
</div>
<!-- end avatar -->
<!-- user bio -->
<div class="author-bio-content">
<h4 class="author-name"><a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>"><?php echo get_the_author_meta( 'display_name' ); ?></a></h4>
<p class="author-description">
<?php echo get_the_author_meta( 'description' ); ?>
</p>
</div><!-- end .author-bio-content -->
</div><!-- end .author-bio -->
</div>
<?php endif; ?>
</article><!-- #post-## -->

97
template-parts/content.php

@ -0,0 +1,97 @@
<?php
/**
* @package sparkling
*/
?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?> data-attr-file="content">
<div class="blog-item-wrap">
<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>" >
<?php
if ( is_page_template( 'page-fullwidth.php' ) ) {
the_post_thumbnail(
'full', array(
'class' => 'single-featured',
)
);
} else {
the_post_thumbnail(
'full', array(
'class' => 'single-featured',
)
);
}
?>
</a>
<div class="post-inner-content">
<header class="entry-header page-header">
<h2 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h2>
</header><!-- .entry-header -->
<?php if ( is_search() ) : // Only display Excerpts for Search ?>
<div class="entry-summary">
<?php the_excerpt(); ?>
<p><a class="btn btn-default read-more" href="<?php the_permalink(); ?>"><?php esc_html_e( 'Read More', 'sparkling' ); ?></a></p>
</div><!-- .entry-summary -->
<?php else : ?>
<div class="entry-content">
<?php
if ( get_theme_mod( 'sparkling_excerpts' ) == 1 ) :
the_excerpt();
?>
<?php if ( 'post' == get_post_type() ) : ?>
<p>
<div class="entry-meta">
<?php sparkling_posted_on(); ?><?php if ( ! post_password_required() && ( comments_open() || '0' != get_comments_number() ) ) : ?>
<span class="comments-link"><i class="fa fa-comments"></i><?php comments_popup_link( esc_html__( 'Leave a comment', 'sparkling' ), esc_html__( '1 Comment', 'sparkling' ), esc_html__( '% Comments', 'sparkling' ) ); ?></span>
<span class='short-link'><i class="fa fa-link"></i> <a class="url fn n" href="<?php echo wp_get_shortlink(); ?>"><?php echo 'Kurzlink' ?></a></span>
<?php endif; ?>
<?php if ( get_edit_post_link() ) : ?>
<?php
edit_post_link(
/*
sprintf(
/* translators: %s: Name of current post
esc_html__( 'Edit %s', 'sparkling' ),
the_title( '<span class="screen-reader-text">"', '"</span>', false )
),*/
'<i class="fa fa-edit"></i><span class="edit-link">',
'</span>'
);
?>
<?php endif; ?>
</div><!-- .entry-meta -->
</p>
<?php endif; ?>
<p><a class="btn btn-default read-more" href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>"><?php esc_html_e( 'Read More', 'sparkling' ); ?></a></p>
<?php
else :
the_content( esc_html__( 'Read More', 'sparkling' ) );
endif;
?>
<?php
wp_link_pages(
array(
'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'sparkling' ),
'after' => '</div>',
'link_before' => '<span>',
'link_after' => '</span>',
'pagelink' => '%',
'echo' => 1,
)
);
?>
</div><!-- .entry-content -->
<?php endif; ?>
</div>
</div>
</article><!-- #post-## -->
Loading…
Cancel
Save