hallo,
ich möchte gerne alle metadaten im post-header haben. leider habe ich keine ahnung von php und bekomme das einfach nich hin.
hier der auszug aus meiner functions.php
PHP
function art_get_post_title() {
global $post;
$post_title = get_the_title();
$art_page_title_show = get_post_meta($post->ID, '_art_page_title_show', true);
if ($art_page_title_show == 'false' || $post_title == ''){
return '';
}
return art_parse_template("post_title", array(
'post_link' => get_permalink($post->ID),
'post_link_title' => sprintf(__('Permanent Link to %s', THEME_NS), the_title_attribute('echo=0')),
'post_title' => get_the_title(),
'template_url' => get_bloginfo('template_url')
));
}
function art_get_post_icon($name){
return art_parse(art_option('metadata.'.$name), array('template_url' => get_bloginfo('template_url')));
}
if (!function_exists('get_the_date')) {
function get_the_date($format = 'F jS, Y') {
return get_the_time(__($format, THEME_NS));
}
}
function art_get_post_metadata($name) {
global $post;
$list = art_option('metadata.'.$name);
$title = ($name == 'header' && art_option('metadata.title'));
if (!$title && $list == "") return;
$list_array = explode(",", $list);
$result = array();
for($i = 0; $i < count($list_array); $i++){
$icon = $list_array[$i];
switch($icon){
case 'date':
if(is_page()) break;
$result[] = art_get_post_icon($icon) . get_the_date();
break;
case 'author':
if(is_page()) break;
ob_start();
the_author_posts_link();
$result[] = art_get_post_icon($icon) . __('Author', THEME_NS) .' '. ob_get_clean();
break;
case 'category':
if(is_page()) break;
$result[] = art_get_post_icon($icon) .sprintf(__('Kategorien %s', THEME_NS), get_the_category_list(', '));
break;
case 'tag':
if(is_page() || !get_the_tags()) break;
ob_start();
the_tags(__('Tags:', THEME_NS) . ' ', ', ', ' ');
$result[] = art_get_post_icon($icon) . ob_get_clean();
break;
case 'comments':
if(is_page() || is_single()) break;
ob_start();
comments_popup_link(__('No Comments »', THEME_NS), __('1 Comment »', THEME_NS), __('% Comments »', THEME_NS), '', __('Comments Closed', THEME_NS) );
$result[] = art_get_post_icon($icon) . ob_get_clean();
break;
case 'edit':
if (!current_user_can('edit_post', $post->ID)) break;
ob_start();
edit_post_link(__('Edit', THEME_NS), '');
$result[] = art_get_post_icon($icon) . ob_get_clean();
break;
}
}
$post_title = art_get_post_title();
if ( ($title && strlen($post_title) > 0) || count($result) > 0 )
return art_parse_template("post_metadata".$name, array(
'post_title' => $post_title,
'post'.$name.'icons' => implode(art_option('metadata.separator'), $result)));
return '';
}
function art_post(){
the_post();
$class = function_exists('get_post_class') ? implode(' ', get_post_class()) : '';
$id = get_the_ID();
if($id != ''){
$id = 'post-' . $id;
}
art_post_box('', art_get_post_content(), $id, $class, array(
'post_title' => art_option('metadata.title') ? '' : art_get_post_title(),
'post_thumbnail' => art_get_post_thumbnail(),
'post_metadataheader' => art_get_post_metadata('header'),
'post_metadatafooter' => art_get_post_metadata('footer')
));
}
function art_post_box($title, $content, $id = '', $class = '', $args = array()){
if ($title != "") {
$title = '<h2 class="art-postheader">'. $title . '</h2>';
}
if (art_option('metadata.title')) {
$content = $title . $content;
$title = '';
}
if ($class != '') {
$class = ' ' .$class;
}
if($id != ''){
$id = 'id="' . $id. '"';
}
echo art_parse_template("post", array_merge(array(
'post_class' => $class,
'post_id' => $id,
'post_thumbnail' => '',
'post_title' => $title,
'post_metadataheader' => '',
'post_content' => $content,
'post_metadatafooter' => ''), $args));
}
Alles anzeigen
hier nochmal eine visuelle darstellung meines problems
http://ge.tt/9Oh45Z6?c
hoffe jmd kann helfen.
gruß Daniel
achja und den link auf den autor würd ich gern nur auf eine mailadresse leiten und nicht auf die artikel des autors. dazu fällt mir auch nichts ein.