Please modify this PHP code (Will Pay)

Discussion in 'PHP' started by TransPersonal, Aug 29, 2009.

  1. #1
    Hi,

    I will pay 15 dollars via paypal to any one who can do this simple job.

    The task:

    In a standard WordPress tag cloud only the tags are shown. The number of posts under each tag is not shown. So I got someone to write this code for me that achieves this:

    <?php
        $query_string = '
            SELECT *,name FROM '.$wpdb->prefix.'term_taxonomy
            JOIN '.$wpdb->prefix.'terms
            ON '.$wpdb->prefix.'term_taxonomy.term_id = '.$wpdb->prefix.'terms.term_id
            WHERE '.$wpdb->prefix.'term_taxonomy.taxonomy = "post_tag"
            ORDER by  '.$wpdb->prefix.'terms.name ASC
        ';
        $post_tags = $wpdb->get_results($query_string);
        ?>
        <div id="a" class="abc_tags">
            <ul>
        <?php
        foreach($post_tags as $key => $tag) {
            $newletter = substr($tag->name, 0, 1);
            if($newletter !== $letter && $key != 0) { ?>
            </ul>
        </div>
        <div id="<?php echo strtolower($newletter); ?>" class="abc_tags">
            <ul>
        <?php   } $letter = substr($tag->name, 0, 1); ?>
                <li><a href="<?php echo get_tag_link($tag->term_id); ?>" title="<?php echo sprintf( __( "View all posts in %s" ), $tag->name ); ?>"><?php echo $tag->name.' ('.$tag->count.')';?></a></li>
            <?php
        }
            ?>
            </ul>
        </div>
    PHP:
    This code displays a vertical tag list alphabetically and with the number of posts under each tag next to it. For example:

    Apple (5)
    Goat (2)
    Zebra (10)

    Problem is, this code shows every tag on my blog - I want it to show only tags under a particular letter. Like all tags starting with the letter "A":

    Apple (5)
    Ax (3)
    Azazel (1)

    So that's what I would like, to modify this code so that it only shows tags from a particular letter alphabetically with the number of posts assigned to the tag next to it.

    (my email)
     
    TransPersonal, Aug 29, 2009 IP
  2. TransPersonal

    TransPersonal Peon

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This offer is no longer valid, the job has been done,

    Thanks.
     
    TransPersonal, Aug 29, 2009 IP