Guten Abend allerseits!
Ich habe ein Problem, an dem ich schon den ganzen Tag sitze und genauso weit bin, wie heute morgen... Ich muss dazu sagen, dass ich mich mit PHP nicht wirklich auskenne :oops:
Ich möchte das Design der Kategorieansicht verändern.
Mein Problem ist, dass ich in den Artikeln zu Anfang immer über <img> ein Bild einbinde. Die Artikel selbst bekommen noch ein Thumbnail.
Wenn ich nun die Kategorie aufrufe, bekomme ich nun das Thumbnail, Artikelüberschrift, das Content und die Tags angezeigt. Leider bleibt im Content die html-formatierung erhalten und die Bilder werden mit angezeigt, was ich aber umgehen möchte.
content.php
<?php
global $post;
theme_post_wrapper(
array(
'id' => theme_get_post_id(),
'class' => theme_get_post_class(),
'thumbnail' => theme_get_post_thumbnail(),
'title' => '<a href="' . get_permalink( $post->ID ) . '" rel="bookmark" title="' . get_the_title() . '">' . get_the_title() . '</a>',
'before' => theme_get_metadata_icons( '', 'header' ),
'content' => theme_get_excerpt(),
'after' => theme_get_metadata_icons( 'tag', 'footer' )
)
);
?>
Alles anzeigen
wenn ich hier
durch
ersetze, dann wandert der ganze inhalt des Artikels - zwar ohne html-formatierung - über das thumbnail und ich egal was ich versucht habe, es bleibt immer dort.
functions.php - theme_get_excerpt - ich kann hier leider nichts damit anfangen :oops:
if (!function_exists('theme_get_excerpt')){
function theme_get_excerpt($args = array()) {
global $post;
$more_tag = theme_get_array_value($args, 'more_tag', __('Continue reading <span class="meta-nav">→</span>', THEME_NS));
$auto = theme_get_array_value($args, 'auto', theme_get_option('theme_metadata_excerpt_auto'));
$all_words = theme_get_array_value($args, 'all_words', theme_get_option('theme_metadata_excerpt_words'));
$min_remainder = theme_get_array_value($args, 'min_remainder', theme_get_option('theme_metadata_excerpt_min_remainder'));
$allowed_tags = theme_get_array_value($args, 'allowed_tags',
(theme_get_option('theme_metadata_excerpt_use_tag_filter')
? explode(',',str_replace(' ', '', theme_get_option('theme_metadata_excerpt_allowed_tags')))
: null));
$perma_link = get_permalink($post->ID);
$more_token = '%%theme_more%%';
$show_more_tag = false;
$tag_disbalance = false;
if (function_exists('post_password_required') && post_password_required($post)){
return get_the_excerpt();
}
if ($auto && has_excerpt($post->ID)) {
$excerpt = get_the_excerpt();
$show_more_tag = mb_strlen($post->post_content) > 0;
} else {
$excerpt = get_the_content($more_token);
// hack for badly written plugins
ob_start();echo apply_filters('get_the_excerpt', $excerpt);$excerpt = ob_get_clean();
ob_start();echo apply_filters('the_excerpt', $excerpt);$excerpt = ob_get_clean();
if(theme_is_empty_html($excerpt)) return $excerpt;
if ($allowed_tags !== null) {
$allowed_tags = '<' .implode('><',$allowed_tags).'>';
$excerpt = strip_tags($excerpt, $allowed_tags);
}
$excerpt = strip_shortcodes($excerpt);
if (strpos($excerpt, $more_token) !== false) {
$excerpt = str_replace($more_token, $more_tag, $excerpt);
} elseif($auto && is_numeric($all_words)) {
$token = "%theme_tag_token%";
$content_parts = explode($token, str_replace(array('<', '>'), array($token.'<', '>'.$token), $excerpt));
$content = array();
$word_count = 0;
foreach($content_parts as $part)
{
if (strpos($part, '<') !== false || strpos($part, '>') !== false){
$content[] = array('type'=>'tag', 'content'=>$part);
} else {
$all_chunks = preg_split('/([\s])/u', $part, -1, PREG_SPLIT_DELIM_CAPTURE);
foreach($all_chunks as $chunk) {
if('' != trim($chunk)) {
$content[] = array('type'=>'word', 'content'=>$chunk);
$word_count += 1;
} elseif($chunk != '') {
$content[] = array('type'=>'space', 'content'=>$chunk);
}
}
}
}
if(($all_words < $word_count) && ($all_words + $min_remainder) <= $word_count) {
$show_more_tag = true;
$tag_disbalance = true;
$current_count = 0;
$excerpt = '';
foreach($content as $node) {
if($node['type'] == 'word') {
$current_count++;
}
$excerpt .= $node['content'];
if ($current_count == $all_words){
break;
}
}
$excerpt .= '…'; // ...
}
}
}
if ($show_more_tag) {
$excerpt = $excerpt.' <a class="more-link" href="'.$perma_link.'">'.$more_tag.'</a>';
}
if ($tag_disbalance) {
$excerpt = force_balance_tags($excerpt);
}
return $excerpt;
}
}
Alles anzeigen
und auf die Seite kommt das ganze über wrappers.php
<?php
// $style = 'post' or 'block' or 'vmenu' or 'simple'
function theme_wrapper($style, $args){
$func_name = "theme_{$style}_wrapper";
if (function_exists($func_name)) {
call_user_func($func_name, $args);
} else {
theme_block_wrapper($args);
}
}
function theme_post_wrapper($args = '') {
$args = wp_parse_args($args,
array(
'id' => '',
'class' => '',
'title' => '',
'thumbnail' => '',
'before' => '',
'content' => '',
'after' => ''
)
);
extract($args);
if (theme_is_empty_html($title) && theme_is_empty_html($content)) return;
if ($id) {
$id = ' id="' . $id . '"';
}
if ($class) {
$class = ' ' . $class;
}
?>
<div class="gi-post<?php echo $class; ?>"<?php echo $id; ?>>
<div class="gi-post-body">
<div class="gi-post-inner gi-article">
<?php
echo $thumbnail;
if (!theme_is_empty_html($title)){
echo '<h2 class="cv">'.$title.'</h2>';
}
?>
<div class="gi-postcontent">
<!-- article-content -->
<?php echo $content; ?>
<!-- /article-content -->
</div>
<div class="cleared"></div>
<?php
echo $after;
?>
</div>
<div class="cleared"></div>
</div>
</div>
<?php
}
Alles anzeigen
Es ist ein Artisteer-theme...
Es wäre echt der Wahnsinn, wenn mir jemand helfen könnte!
Vielen Dank im vorraus,
UGeen