Beispiel #1
0
 * @package WordPress
 * @subpackage Dwarsloeper
 * @since Dwarsloeper 1.0
 */
global $options;
get_header();
?>


	<section id="hero" class="hero-small">
		<div class="container">
			<div class="row">
				<div class="span12">
					<div class="breadcrumbs">
						<a href="<?php 
echo dl_esc_url(home_url('/'));
?>
"><?php 
echo $options['breadcrumb_root'];
?>
</a>
					</div>

					<div class="hero-meta-portal">
						401
					</div>
				</div>
			</div>
			<div class="row">
				<div class="span6">
					<h1><?php 
Beispiel #2
0
			<div class="row">
				<div class="span8">
					
					<article class="news-details">
						<?php 
    if (has_post_thumbnail() && !post_password_required()) {
        ?>
							<div class="post-image">
								<?php 
        $bildunterschrift = get_post_meta($post->ID, 'dlval_overwrite_thumbdesc', true);
        $post_thumbnail_id = get_post_thumbnail_id();
        if ($post_thumbnail_id) {
            $full_image_attributes = wp_get_attachment_image_src($post_thumbnail_id, 'full');
            echo '<a class="lightbox" href="' . dl_esc_url($full_image_attributes[0]) . '">';
            $image_attributes = wp_get_attachment_image_src($post_thumbnail_id, 'post');
            echo '<img src="' . dl_esc_url($image_attributes[0]) . '" class="attachment-post wp-post-image" width="' . $image_attributes[1] . '" height="' . $image_attributes[1] . '" ' . 'title="' . get_the_title() . '" alt="">';
            echo '</a>';
            if (isset($bildunterschrift) && strlen($bildunterschrift) > 1) {
                echo '<div class="post-image-caption">' . $bildunterschrift . '</div>';
            } elseif (get_post(get_post_thumbnail_id()) && get_post(get_post_thumbnail_id())->post_excerpt != '') {
                echo '<div class="post-image-caption">' . get_post(get_post_thumbnail_id())->post_excerpt . '</div>';
            }
        }
        ?>
							</div>

						<?php 
    }
    $output = '';
    $categories = get_the_category();
    $separator = ",\n ";
Beispiel #3
0
function dl_display_search_resultitem()
{
    global $post;
    global $options;
    $output = '';
    $withthumb = $options['search_display_post_thumbnails'];
    $withcats = $options['search_display_post_cats'];
    if (isset($post) && isset($post->ID)) {
        $link = get_post_meta($post->ID, 'external_link', true);
        $external = 0;
        if (isset($link) && filter_var($link, FILTER_VALIDATE_URL)) {
            $external = 1;
        } else {
            $link = dl_make_link_relative(get_permalink($post->ID));
        }
        $output .= '<article class="search-result">' . "\n";
        $output .= "\t<h3><a ";
        if ($external == 1) {
            $output .= 'class="ext-link" ';
        }
        $output .= "href=\"" . $link . "\">" . get_the_title() . "</a></h3>\n";
        $type = get_post_type();
        if ($type == 'post') {
            $typestr = '<div class="search-meta">';
            $categories = get_the_category();
            $separator = ', ';
            $thiscatstr = '';
            if ($withcats == true && $categories) {
                $typestr .= '<span class="post-meta-category"> ';
                $typestr .= __('Kategorie', 'dltextdom');
                $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> ';
            }
            $topevent_date = get_post_meta($post->ID, 'topevent_date', true);
            if ($topevent_date) {
                $typestr .= '<span class="post-meta-date"> ';
                $typestr .= date_i18n(get_option('date_format'), strtotime($topevent_date));
                $typestr .= ' (';
                $typestr .= __('Veranstaltungshinweis', 'dltextdom');
                $typestr .= ')';
                $typestr .= '</span>';
            } else {
                $typestr .= '<span class="post-meta-date"> ';
                $typestr .= get_the_date();
                $typestr .= '</span>';
            }
            $typestr .= '</div>' . "\n";
        } elseif ($type == 'event') {
            $typestr = '<div class="search-meta">';
            $typestr .= '<span class="post-meta-event"> ';
            $typestr .= __('Veranstaltungshinweis', 'dltextdom');
            $typestr .= '</span>';
            $typestr .= '</div>' . "\n";
        } else {
            $typestr = '';
        }
        if (!empty($typestr)) {
            $output .= "\t" . $typestr . "\n";
        }
        $output .= "\t" . '<div class="row">' . "\n";
        if ($withthumb == true && has_post_thumbnail($post->ID)) {
            $output .= "\t\t" . '<div class="span3">' . "\n";
            $output .= '<a href="' . $link . '" class="news-image';
            if ($external == 1) {
                $output .= ' ext-link';
            }
            $output .= '">';
            $post_thumbnail_id = get_post_thumbnail_id($post->ID, 'post-thumb');
            $imagehtml = '';
            if ($post_thumbnail_id) {
                $sliderimage = wp_get_attachment_image_src($post_thumbnail_id, 'post-thumb');
                $imageurl = $sliderimage[0];
            }
            if (!isset($imageurl) || strlen(trim($imageurl)) < 4) {
                $imageurl = $options['default_postthumb_src'];
            }
            $output .= '<img src="' . dl_esc_url($imageurl) . '" width="' . $options['default_postthumb_width'] . '" height="' . $options['default_postthumb_height'] . '" alt="">';
            $output .= '</a>';
            $output .= "\t\t" . '</div>' . "\n";
            $output .= "\t\t" . '<div class="span5">' . "\n";
        } else {
            $output .= "\t\t" . '<div class="span8">' . "\n";
        }
        $output .= "\t\t" . '<p>' . "\n";
        $output .= dl_custom_excerpt($post->ID, $options['default_search_excerpt_length'], false, '', true, $options['search_display_excerpt_morestring']);
        if ($options['search_display_continue_arrow']) {
            $output .= '<a class="read-more-arrow';
            if ($external == 1) {
                $output .= ' ext-link';
            }
            $output .= '" href="' . $link . '">›</a>';
        }
        $output .= "\t\t\t" . '</p>' . "\n";
        $output .= "\t</div> <!-- /row -->\n";
        $output .= "</article>\n";
    } else {
        $output .= "<!-- empty result -->\n";
    }
    return $output;
}
Beispiel #4
0
 function start_el(&$output, $item, $depth = 0, $args = array(), $id = 0)
 {
     global $options;
     $indent = $depth ? str_repeat("\t", $depth) : '';
     if (isset($this->count[$this->level])) {
         $this->count[$this->level]++;
     } else {
         $this->count[$this->level] = 1;
     }
     if ($this->level == 1) {
         $this->element = $item;
     }
     $item_output = '';
     // Only show elements on the first level and only five on the second level, but only if showdescription == FALSE
     if ($this->level == 1 || $this->level == 2 && $this->count[$this->level] <= $this->maxsecondlevel && $this->showsub == 1) {
         $class_names = $value = '';
         $classes = empty($item->classes) ? array() : (array) $item->classes;
         $classes[] = 'menu-item-' . $item->ID;
         if ($this->level == 1 && isset($this->count[$this->level]) && ($this->count[$this->level] - 1) % $this->maxspalten == 0) {
             $classes[] = 'clear';
         }
         if ($this->level == 1) {
             $classes[] = 'span3';
         }
         //	$classes[] = 'level'.$this->level;
         //	$classes[] = 'count'.$this->count[$this->level];
         $class_names = join(' ', apply_filters('nav_menu_css_class', array_filter($classes), $item, $args));
         $class_names = $class_names ? ' class="' . esc_attr($class_names) . '"' : '';
         $id = apply_filters('nav_menu_item_id', 'menu-item-' . $item->ID, $item, $args);
         $id = $id ? ' id="' . esc_attr($id) . '"' : '';
         if ($this->level == 1) {
             $output .= $indent . '<li' . $id . $value . $class_names . '>';
         } else {
             $output .= '<li>';
         }
         $atts = array();
         $atts['title'] = !empty($item->attr_title) ? $item->attr_title : '';
         $atts['target'] = !empty($item->target) ? $item->target : '';
         $atts['rel'] = !empty($item->xfn) ? $item->xfn : '';
         $post = get_post($item->object_id);
         if ($post && $post->post_type != 'imagelink') {
             $atts['href'] = !empty($item->url) ? $item->url : '';
         }
         if ($this->level == 1) {
             $atts['class'] = 'subpage-item';
         }
         $atts = apply_filters('nav_menu_link_attributes', $atts, $item, $args);
         $attributes = '';
         foreach ($atts as $attr => $value) {
             if (!empty($value)) {
                 $value = 'href' === $attr ? esc_url($value) : esc_attr($value);
                 $attributes .= ' ' . $attr . '="' . $value . '"';
             }
         }
         $item_output = $args->before;
         if ($post && $post->post_type == 'imagelink') {
             $protocol = get_post_meta($item->object_id, 'protocol', true);
             $link = get_post_meta($item->object_id, 'link', true);
             $targeturl = get_post_meta($item->object_id, 'dlval_imagelink_url', true);
             if (empty($targeturl) && isset($protocol) && isset($link)) {
                 $targeturl = $protocol . $link;
             }
             $item_output .= '<a class="subpage-item ext-link" href="' . $targeturl . '">';
         } else {
             $item_output .= '<a' . $attributes . '>';
         }
         if ($this->level == 1) {
             if (!$this->nothumbnail) {
                 $post_thumbnail_id = get_post_thumbnail_id($item->object_id, 'page-thumb');
                 $imagehtml = '';
                 $imageurl = '';
                 if ($post_thumbnail_id) {
                     $thisimage = wp_get_attachment_image_src($post_thumbnail_id, 'page-thumb');
                     $imageurl = $thisimage[0];
                 }
                 if ((!isset($imageurl) || strlen(trim($imageurl)) < 4) && !$this->nothumbnailfallback) {
                     $imageurl = $options['default_submenuthumb_src'];
                 }
                 if (!empty($imageurl)) {
                     $item_output .= '<img src="' . dl_esc_url($imageurl) . '" width="' . $options['default_submenuthumb_width'] . '" height="' . $options['default_submenuthumb_height'] . '" alt="">';
                 }
             }
             if ($post && $post->post_type == 'imagelink') {
                 $item_output .= '<div class="ext-icon"></div>';
             }
             $item_output .= $args->link_before . '<h3>' . apply_filters('the_title', $item->title, $item->ID) . '</h3>' . $args->link_after;
         } else {
             $item_output .= $args->link_before . apply_filters('the_title', $item->title, $item->ID) . $args->link_after;
         }
         $item_output .= '</a>';
         $item_output .= $args->after;
         if (!($this->showsub == 1) && $this->level == 1) {
             $desc = get_post_meta($item->object_id, 'portal_description', true);
             // Wird bei Bildlink definiert
             if ($desc) {
                 $item_output .= '<p>' . $desc . '</p>';
             }
         }
     }
     $output .= apply_filters('walker_nav_menu_start_el', $item_output, $item, $depth, $args);
 }
Beispiel #5
0
			</div>
		</noscript>
		<?php 
}
?>
		<header id="header">
			<div class="container">
		    
				<?php 
$header_image = get_header_image();
if (!empty($header_image)) {
    echo '<div class="branding" id="logo" role="banner" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">';
    if (!is_front_page()) {
        echo '<a itemprop="url" rel="home" href="' . dl_esc_url(home_url('/')) . '">';
    }
    echo '<img src="' . dl_esc_url($header_image) . '" width="' . get_custom_header()->width . '" height="' . get_custom_header()->height . '" alt="' . get_bloginfo('title') . '">';
    if (!is_front_page()) {
        echo "</a>";
    }
    echo "</div>\n";
}
?>
				<a href="#" id="nav-toggle" class="hide-desktop">
					<div></div>
					<div></div>
					<div></div>
				</a>			
				<?php 
if (has_nav_menu('main-menu') && class_exists('Walker_Main_Menu', false)) {
    wp_nav_menu(array('theme_location' => 'main-menu', 'container' => false, 'items_wrap' => '<ul role="navigation" aria-label="' . __("Navigation", "fau") . '" id="nav">%3$s</ul>', 'depth' => 2, 'walker' => new Walker_Main_Menu()));
} elseif (!has_nav_menu('main-menu')) {
Beispiel #6
0
function dl_do_metabox_post_topevent($object, $box)
{
    global $options;
    wp_nonce_field(basename(__FILE__), 'dl_metabox_post_topevent_nonce');
    $post_type = get_post_type($object->ID);
    if ('post' == $post_type) {
        if (!current_user_can('edit_post', $object->ID)) {
            return;
        }
    } else {
        return;
    }
    $topevent_desc = get_post_meta($object->ID, 'topevent_description', true);
    $topevent_date = get_post_meta($object->ID, 'topevent_date', true);
    $topevent_image = get_post_meta($object->ID, 'topevent_image', true);
    ?>

	
	
	<p>
	   <?php 
    echo __('Bitte beachten: Damit ein Artikel als Top-Event angezeigt wird, muss er das folgende Schlagwort erhalten: ', 'dltextdom');
    echo '<b>' . $options['start_topevents_tag'] . '</b>';
    ?>
	</p>
	
	
	<?php 
    $topevent_title = get_post_meta($object->ID, 'topevent_title', true);
    dl_form_text('dlval_topevent_title', $topevent_title, __('Titel', 'dltextdom'), __('Titel wie er in der Sidebar erscheinen soll. Wenn leer, wird der normale Titel des Beitrags verwendet.', 'dltextdom'));
    ?>

	
	
	<div class="optionseingabe">
	    <p>
		    <label for="dlval_topevent_desc">
			<?php 
    _e("Kurzbeschreibung", 'dltextdom');
    ?>
:
		    </label>
	    </p>
	    <textarea name="dlval_topevent_desc" id="dlval_topevent_desc" class="large-text" rows="3" ><?php 
    echo $topevent_desc;
    ?>
</textarea>	
	    <br>
	    <div class="howto"><?php 
    echo __('Kurztext für die Sidebar. Wenn leer, wird der Anleser verwendet.', 'dltextdom');
    echo ' ' . __('Erlaubte Anzahl an Zeichen:', 'dltextdom');
    echo ' <span class="dlval_topevent_desc_signs">' . $options['default_topevent_excerpt_length'] . '</span>';
    ?>
</div>
	</div>
	<div class="optionseingabe">
	    <p>
		    <label for="dlval_topevent_date">
			<?php 
    _e("Datum", 'dltextdom');
    ?>
:
		    </label>
	    </p>
	    <input type="date" name="dlval_topevent_date" id="dlval_topevent_date" class="text" value="<?php 
    echo $topevent_date;
    ?>
">		
	    <br>
	    
	    
	    <div class="howto"><?php 
    echo __('Geben Sie hier das Datum des Events ein.', 'dltextdom');
    ?>
</div>
	    
	    <script type="text/javascript">
jQuery(document).ready(function() {
    jQuery('#dlval_topevent_date').datepicker();
});
</script>
	    
	    
	</div>
	
	<div class="optionseingabe">
	    <p>
		    <label for="dlval_topevent_image">
			<?php 
    _e("Symbolbild", 'dltextdom');
    ?>
:
		    </label>
	    </p>

	    <?php 
    echo '<div class="uploader">';
    $image = '';
    $imagehtml = '';
    if (isset($topevent_image) && $topevent_image > 0) {
        $image = wp_get_attachment_image_src($topevent_image, 'topevent-thumb');
        if (isset($image)) {
            $imagehtml = '<img class="image_show_topevent_image" src="' . $image[0] . '" width="' . $options['default_topevent_thumb_width'] . '" height="' . $options['default_topevent_thumb_height'] . '" alt="">';
        }
    }
    echo '<div class="previewimage showimg_topevent_image">';
    if (!empty($imagehtml)) {
        echo $imagehtml;
    } else {
        $imagehtml = '<img src="' . dl_esc_url($options['default_topevent_thumb_src']) . '" width="' . $options['default_topevent_thumb_width'] . '" height="' . $options['default_topevent_thumb_height'] . '" alt="">';
        echo $imagehtml;
        echo "<br>";
        _e('Kein Bild ausgewählt. Ersatzbild wird gezeigt.', 'dltextdom');
    }
    echo "</div>\n";
    ?>
		

	    <input type="hidden" name="dlval_topevent_image" id="dlval_topevent_image" 
		     value="<?php 
    echo sanitize_key($topevent_image);
    ?>
" />

	    <input class="button" name="image_button_topevent_image" id="image_button_topevent_image" value="<?php 
    _e('Bild auswählen', 'dltextdom');
    ?>
" />
	    <small><a href="#" class="image_remove_topevent_image"><?php 
    _e("Entfernen", 'dltextdom');
    ?>
</a></small>
	    <br><div class="howto"><?php 
    echo __('Hier können Sie ein Thumbnail auswählen für den Event. Wenn kein Bild gewählt wird, wird ein Ersatzbild angezeigt.', 'dltextdom');
    ?>
	      
	    </div><script>
	    jQuery(document).ready(function() {
		jQuery('#image_button_topevent_image').click(function()  {
		    wp.media.editor.send.attachment = function(props, attachment) {
			jQuery('#dlval_topevent_image').val(attachment.id);
			htmlshow = "<img src=\""+attachment.url + "\" width=\"<?php 
    echo $options['default_topevent_thumb_width'];
    ?>
\" height=\"<?php 
    echo $options['default_topevent_thumb_height'];
    ?>
\">";  					   
			jQuery('.showimg_topevent_image').html(htmlshow);

		    }
		    wp.media.editor.open(this);
		    return false;
		});
	    });
	    jQuery(document).ready(function() {
		jQuery('.image_remove_topevent_image').click(function()   {
			jQuery('#dlval_topevent_image').val('');
			jQuery('.showimg_topevent_image').html('<?php 
    _e('Kein Bild ausgewählt.', 'dltextdom');
    ?>
');
			return false;
		});
	    });
	   </script> 		    	    
	    
	   </div>
	</div>
	
	
	<?php 
}
Beispiel #7
0
    echo $titel;
    ?>
</a></h2>
							
							<div class="row">
							    <?php 
    $imageid = get_post_meta($topevent->ID, 'topevent_image', true);
    $imagehtml = '';
    if (isset($imageid) && $imageid > 0) {
        $image = wp_get_attachment_image_src($imageid, 'topevent-thumb');
        if ($image && $image[0]) {
            $imagehtml = '<img src="' . dl_esc_url($image[0]) . '" width="' . $options['default_topevent_thumb_width'] . '" height="' . $options['default_topevent_thumb_height'] . '" alt="">';
        }
    }
    if (empty($imagehtml)) {
        $imagehtml = '<img src="' . dl_esc_url($options['default_topevent_thumb_src']) . '" width="' . $options['default_topevent_thumb_width'] . '" height="' . $options['default_topevent_thumb_height'] . '" alt="">';
    }
    if (isset($imagehtml)) {
        ?>
								<div class="span2">
									<?php 
        echo '<a href="' . $link . '">' . $imagehtml . '</a>';
        ?>
								</div>
								<div class="span2">
							    <?php 
    } else {
        ?>
								<div class="span4">
							    <?php 
    }