;

Blog-nya Pai

Icon

This is my lounge, enjoy it !

Menambah recent comment pada grid focus 1.0

Buat pengguna wordpress mungkin ada yang mengenal theme grid focus public 1.0 , dengan tampilan 3 kolom,minimalis tapi membutuhkan sedikit kerja keras untuk mendapatkan hasil yang maksimal. hahahah (berlebihan) .

Pada punya blog saya, saya menampilkan recent comment pada kolom ketiga, maka yang akan diedit adalah file third.php. kita tambahkan baris berikut di file third.php

<div id="recentandshout">
<h3>Recent Comments</h3>
<?php
 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,90) 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 10"
;<br />
 $comments = $wpdb->get_results($sql);
 $output = $pre_HTML;
 $output .= "
<ul>"
;
 foreach ($comments as $comment) {
 $output .= "
<li>"
."<b>".strip_tags($comment->comment_author)."</b>"." : " . "<i><a href=\"" . get_permalink($comment->ID) ."#comment-" . $comment->comment_ID . "\" title=\"on " .$comment->post_title . "\">" . strip_tags($comment->com_excerpt)."."."</a></i></li>
"
;
 }
 $output .= "</ul>
"
;
 $output .= $post_HTML;
 echo $output;?>

</div>

naruhnya diantara

<div id="tertCol">
......
</div>
<!-- close #tertCol --><br />

gampang kan… neh contoh file third.php punya saya

<div id="tertCol">

    <div id="recentandshout">

<!-- Begin ShoutMix - http://www.shoutmix.com --><iframe title="pupuklangka" src="http://www6.shoutmix.com/?pupuklangka" width="230" height="400" frameborder="0" scrolling="auto"><a href="http://www6.shoutmix.com/?pupuklangka">View shoutbox</a></iframe><br /><br /><!-- End ShoutMix -->
</div>
<h4>Recent Posts</h4>
<hr />
<?php mdv_recent_posts(); ?>

<h4>&nbsp;</h4>
<h4>Recent Comments</h4>
<hr />
<?php
    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,90) 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 10"
;
    $comments = $wpdb->get_results($sql);
    $output = $pre_HTML;
    $output .= "<ul>";
    foreach ($comments as $comment) {

    $output .= "<li>"."<b>".strip_tags($comment->comment_author)."</b>"." : " . "<a href=\"" . get_permalink($comment->ID) ."#comment-" . $comment->comment_ID . "\" title=\"on " .$comment->post_title . "\">" . strip_tags($comment->com_excerpt)."."."</a></li>";
    }
    $output .= "</ul>";
    $output .= $post_HTML;
    echo $output;?>

</div><!-- close #tertCol -->

Related posts:

  1. Menambah Gravatar pada comment wordpress
  2. Memberi image header pada grid focus public 1.0
  3. Menambah Speed Dial pada Opera
  4. Menambahkan browser dan OS pada komentar wordpress
  5. Edit widget meta pada wordpress

Category: Internet

Tagged: , , , , , , , ,

Leave a Reply

[+] kaskus emoticons nartzco