Hallo,
mit 3.0 wurde die datei comment.php ja fast überflüssig, das Formular ist ja nun im Core integriert.
Mein altes Theme habe ich nun an die neue Funktion angepasst und demenstprechend alte Angaben gelöscht. Dadurch ist der Code nun viel übersichtlicher und schlanker.
Meine Frage aber nun, da das Theme welches ich verwende nicht komplett von mir ist, die functions.php habe ich mit weiteren kleinen Dingen fast 1:1 übernommen.
Dort stehen beispielsweise auch Sachen zu Comments drin. Meine Frage ist nun, sind diese angaben nun auch überflüssig so dass ich sie ohne bedenken löschen kann? Leider kann ich mit dem Php Code nicht sehr viel anfangen, evtl. könnte ja mal jemand von euch drüber schauen und mir sagen, worum es sich dabei handelt. Hier wären ein paar dieser Code Schnipsel:
function mytheme_comment($comment, $args, $depth) {
$GLOBALS['comment'] = $comment;
?>
<li <?php comment_class(); ?> id="li-comment-<?php comment_ID() ?>">
<div id="comment-<?php comment_ID(); ?>">
<div class="right">
<?php if ($comment->comment_approved == '0') : ?>
<strong><?php _e('Waiting for the admin to approve your comment. Please be patient.'); ?></strong>
<br />
<?php endif; ?>
Alles anzeigen
function rc(){
global $wpdb;
$sql = "SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,15) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = '1' AND comment_type = '' AND post_password = '' ORDER BY comment_date_gmt DESC LIMIT 8";
$comments = $wpdb->get_results($sql);
$output = $pre_HTML;
foreach($comments as $comment){
$before = '<li class="rc"> ';
$after = '</li>';
if(strlen($comment->com_excerpt) >= 15){
$comment->com_excerpt .= '...';
}
$output .= $before . '<a href="' . get_permalink($comment->ID) . '#comment-' . $comment->comment_ID . '" title="'. $comment->comment_author . __(' comments on ', 'pyrmont_v2') .$comment->post_title . '">' . strip_tags($comment->comment_author) . '</a>' . ': ' . '<span class="excerpt">' . strip_tags($comment->com_excerpt) . '</span>' . $after;
}
$output .= $post_HTML;
echo $output;
}
Alles anzeigen
add_action ('init','my_theme_init');
function my_theme_init (){
load_theme_textdomain ('pyrmont_v2', get_template_directory() . '/languages');
}
?>
Okay, ich hoffe das ist doch nicht allzuviel geworden, das ist fast die komplette Functions.php
Es wäre wahnsinnig nett, wenn ein PHP Mensch mal drübergucken könnte, und mir sagen was weg kann oder noch besser, mir die Dinge beschreiben :-?