Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
xwolfde committed Dec 13, 2017
1 parent ec56dba commit 3717708
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 30 deletions.
2 changes: 1 addition & 1 deletion css/sass/_variables.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//-----------------------------------------------------------------------------------*/
// Konstanten fuer das Design
//-----------------------------------------------------------------------------------*/
$version: '1.9.0';
$version: '1.9.1';
// Theme Version
// First Digit: Manual
// Second Digit: Branch Version
Expand Down
4 changes: 3 additions & 1 deletion functions/constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,9 @@ function fau_initoptions() {
'google-site-verification' => array(
'type' => 'text',
'title' => __( 'Google Site Verification', 'fau' ),
'label' => __( 'Meta-Tag zur Identifikation der Inhaberschaft gegenüber Google. geben Sie hier den Content-Bestand an für die Identifikation mittels Meta-Tag.', 'fau' ),
'label' => __( 'Zur Verifikation der Website als Property in den <a target="_blank" href="https://www.google.com/webmasters/tools/home">Google Webmaster Tools</a> wird die Methode über den HTML-Tag ausgewählt. '
. 'Google erstellt dann auf der Einrichtungsseite eine HTML-Anweisung. Von dieser Anweisung kopiert man den Bestandteil, der im Attribut "content" angegeben ist. <br>'
. 'Beispiel: <br>Google gibt den HTML-Code: &nbsp; &nbsp;<code>&lt;meta name="google-site-verification" content="BBssyCpddd8" /&gt;</code><br> Dann geben Sie dies ein: <code>BBssyCpddd8</code> .', 'fau' ),
'default' => $defaultoptions['google-site-verification'],
),
'url_banner-ad-notice' => array(
Expand Down
19 changes: 16 additions & 3 deletions functions/shortcodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,7 @@ function fau_shortcode_blogroll( $atts, $content = null ) {
'tag' => '',
'num' => '',
'divclass' => '',
'hidemeta' => false,
'hstart' => 2,
), $atts));

Expand All @@ -523,10 +524,16 @@ function fau_shortcode_blogroll( $atts, $content = null ) {
$hstart = ($hstart) ? intval($hstart) : 2;
$divclass = $divclass ? esc_attr( $divclass ) : '';

$out = fau_blogroll($tag, $cat, $num, $divclass, $hstart);

if (!is_page()) {
$out = '<p class="attention">'.__("Der Shortcode darf nur auf Seiten verwendet werden.",'fau').'</p>';
return $out;
}

$out = fau_blogroll($tag, $cat, $num, $divclass, $hstart,$hidemeta);

if (empty($out)) {
$out = '<p class="box red-box">'.__("Es konnten keine Artikel gefunden werden",'fau').'</p>';
$out = '<p class="attention">'.__("Es konnten keine Artikel gefunden werden",'fau').'</p>';
}
return $out;
}
Expand All @@ -546,10 +553,16 @@ function fau_shortcode_articlelist( $atts, $content = null ) {
$tag = ($tag) ? $tag : '';
$num = ($num) ? intval($num) : 5;
$class = ($class) ? $class : '';

if (!is_page()) {
$out = '<p class="attention">'.__("Der Shortcode darf nur auf Seiten verwendet werden.",'fau').'</p>';
return $out;
}

$out = fau_articlelist($tag, $cat, $num,$class, $title);

if (empty($out)) {
$out = '<p class="box red-box">'.__("Es konnten keine Artikel gefunden werden",'fau').'</p>';
$out = '<p class="attention">'.__("Es konnten keine Artikel gefunden werden",'fau').'</p>';
}
return $out;
}
Expand Down
49 changes: 25 additions & 24 deletions functions/template-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ function fau_display_search_resultitem($withsidebar = 1) {
/*-----------------------------------------------------------------------------------*/
/* Blogroll
/*-----------------------------------------------------------------------------------*/
function fau_display_news_teaser($id = 0, $withdate = false, $hstart = 2) {
function fau_display_news_teaser($id = 0, $withdate = false, $hstart = 2, $hidemeta = false) {
if ($id ==0) return;
global $options;

Expand Down Expand Up @@ -511,30 +511,31 @@ function fau_display_news_teaser($id = 0, $withdate = false, $hstart = 2) {
$output .= 'href="'.$link.'">'.get_the_title($post->ID).'</a>';
$output .= "</h".$hstart.">";


$categories = get_the_category();
$separator = ', ';
$thiscatstr = '';
$typestr = '';
if($categories){
$typestr .= '<span class="news-meta-categories"> ';
$typestr .= __('Kategorie', 'fau');
$typestr .= ': ';
foreach($categories as $category) {
$thiscatstr .= '<a href="'.get_category_link( $category->term_id ).'">'.$category->cat_name.'</a>'.$separator;
if ($hidemeta == false) {
$categories = get_the_category();
$separator = ', ';
$thiscatstr = '';
$typestr = '';
if($categories){
$typestr .= '<span class="news-meta-categories"> ';
$typestr .= __('Kategorie', 'fau');
$typestr .= ': ';
foreach($categories as $category) {
$thiscatstr .= '<a href="'.get_category_link( $category->term_id ).'">'.$category->cat_name.'</a>'.$separator;
}
$typestr .= trim($thiscatstr, $separator);
$typestr .= '</span> ';
}
$typestr .= trim($thiscatstr, $separator);
$typestr .= '</span> ';
}


if ($withdate) {
$output .= '<div class="news-meta">';
$output .= $typestr;
$output .= '<span class="news-meta-date" itemprop="datePublished" content="'. esc_attr( get_post_time('c') ).'"> '.get_the_date('',$post->ID)."</span>";
$output .= '</div>';
} else {
$output .= '<meta itemprop="datePublished" content="'. esc_attr( get_post_time('c') ).'">';
if ($withdate) {
$output .= '<div class="news-meta">';
$output .= $typestr;
$output .= '<span class="news-meta-date" itemprop="datePublished" content="'. esc_attr( get_post_time('c') ).'"> '.get_the_date('',$post->ID)."</span>";
$output .= '</div>';
} else {
$output .= '<meta itemprop="datePublished" content="'. esc_attr( get_post_time('c') ).'">';
}
}
$output .= '<meta itemprop="dateModified" content="'. esc_attr( get_the_modified_time('c') ).'">';

Expand Down Expand Up @@ -1432,7 +1433,7 @@ function fau_get_tag_ID($tag_name) {
/* Display blog entries as blogroll
/*-----------------------------------------------------------------------------------*/
if ( ! function_exists( 'fau_blogroll' ) ) :
function fau_blogroll($posttag = '', $postcat = '', $num = 4, $divclass= '', $hstart = 2) {
function fau_blogroll($posttag = '', $postcat = '', $num = 4, $divclass= '', $hstart = 2, $hidemeta = false) {
$posttag = $posttag ? esc_attr( $posttag ) : '';

if ((!isset($posttag)) && (!isset($postcat))) {
Expand Down Expand Up @@ -1477,7 +1478,7 @@ function fau_blogroll($posttag = '', $postcat = '', $num = 4, $divclass= '', $hs
while($blogroll_query->have_posts()) :
$blogroll_query->the_post();
$id = get_the_ID();
$out .= fau_display_news_teaser($id,true,$hstart);
$out .= fau_display_news_teaser($id,true,$hstart,$hidemeta);
// $out .= fau_load_template_part('template-parts/content-blogroll' ); // fau_display_news_teaser($id,true); //
endwhile;
endif; // have_posts()
Expand Down
2 changes: 1 addition & 1 deletion style.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3717708

Please sign in to comment.