1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

What's the shorcode for...

Discussion in 'WordPress' started by Bizza, Mar 18, 2011.

  1. #1
    Does anyone know what the shortcode is to display registered member numbers on WordPress?
     
    Bizza, Mar 18, 2011 IP
  2. dsimi

    dsimi Member

    Messages:
    265
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    48
    #2
    No short code i think. The following code will help
    
    $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
    echo $users." registered users.";
    
    Code (markup):
     
    dsimi, Mar 18, 2011 IP
  3. Bizza

    Bizza Active Member

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #3
    Thanks Dsimi :)

    Where do I put this code? I tried just pasting it to the footer and a stats widget, but both just showed the same code's text, as is. Any help with this? Cheers.
     
    Bizza, Mar 19, 2011 IP
  4. benims

    benims Peon

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I used to need that too
     
    benims, Mar 19, 2011 IP
  5. dsimi

    dsimi Member

    Messages:
    265
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    48
    #5
    If u want to show the users number in footer, paste the code into footer.php .But start with php tag like below

    
    <?php
    $users = $wpdb->get_var("SELECT COUNT(ID) FROM $wpdb->users");
    echo $users." registered users.";
    ?>
    
    Code (markup):
     
    dsimi, Mar 19, 2011 IP
  6. Bizza

    Bizza Active Member

    Messages:
    153
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    53
    #6
    Thank you Dsimi ;)
     
    Bizza, Mar 27, 2011 IP