Hacks 4 WordPress

1.

Popular Posts

2.

    3. get_results(“SELECT comment_count,ID,post_title FROM $wpdb->posts ORDER BY comment_count DESC LIMIT 0 , 5”);
    4. foreach ($result as $post) {
    5. setup_postdata($post);
    6. $postid = $post->ID;
    7. $title = $post->post_title;
    8. $commentcount = $post->comment_count;
    9. if ($commentcount != 0) { ?>
    10.

  • <a href="%3C?php%20echo%20get_permalink%28$postid%29;%20?%3E" title="”>
    11. {}
  • 12.
    13.
    14.

——————————————–
1. ID);
4. if ($tags) {
5. echo ‘Related Posts’;
6. $first_tag = $tags[0]->term_id;
7. $args=array(
8. ‘tag__in’ => array($first_tag),
9. ‘post__not_in’ => array($post->ID),
10. ‘showposts’=>5,
11. ‘caller_get_posts’=>1
12. );
13. $my_query = new WP_Query($args);
14. if( $my_query->have_posts() ) {
15. while ($my_query->have_posts()) : $my_query->the_post(); ?>
16.
17. <a href="%3C?php%20the_permalink%28%29%20?%3E" rel="bookmark" title="Permanent Link to “>
18.
19.

——————————

1. function catch_that_image() {
2. global $post, $posts;
3. $first_img = ”;
4. ob_start();
5. ob_end_clean();
6. $output = preg_match_all(‘/<img .+src="['"]([

Advertisements

~ by netlex on June 15, 2009.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: