+ Reply to Thread
Results 1 to 4 of 4

Thread: wordpress article count

  1. #1
    ata.online is offline x10 Sophmore ata.online is an unknown quantity at this point
    Join Date
    Oct 2009
    Location
    England
    Posts
    159

    Question wordpress article count

    Hi,

    Referring to my original site:
    http://www.ata-articles.com/, does anyone know how i can correct the article count on this site which is similar to: http://www.ataarticles.com/ (hosted on x10hosting account). At present it has over 68000 articles but only under 4000 articles.

    I tried to add the following by going into Editor (header section). Also i checked the pages section and added all the details, but still no difference.
    Thanks.
    Last edited by ata.online; 05-13-2010 at 05:45 PM.

  2. #2
    ata.online is offline x10 Sophmore ata.online is an unknown quantity at this point
    Join Date
    Oct 2009
    Location
    England
    Posts
    159

    Re: wordpress article count

    I found the code in Editor Main template:

    <p>There are <strong><?php echo $numposts ?></strong> published articles and <strong><?php echo $users ?></strong> registered authors in our article directory.</p>

    The html <strong> seems to be code that controls the article count. How can i correct this?

    Thanks.

  3. #3
    techairlines's Avatar
    techairlines is offline x10 Flyer techairlines has much to be proud oftechairlines has much to be proud of
    Join Date
    Jul 2009
    Location
    New York City
    Posts
    2,853

    Re: wordpress article count

    What is the PHP code for $numposts? Might be somewhere in functions.php of your theme. It should be:

    PHP Code:
    <?php
    $count_posts 
    wp_count_posts();
    ?>
    (Your can replace count_posts with numposts)

    Function Reference: http://codex.wordpress.org/Function_...wp_count_posts
    Last edited by techairlines; 05-13-2010 at 06:53 PM.
    Best regards,
    Brian Yang - TechAirlines


    How am I doing? Click the star button at the bottom left to rate this post. Thanks.
    Terms of Service | Account Portal | Wiki

  4. #4
    ata.online is offline x10 Sophmore ata.online is an unknown quantity at this point
    Join Date
    Oct 2009
    Location
    England
    Posts
    159

    Re: wordpress article count

    Hi,
    In functions.php, i found the following code for posts:


    /* Number of posts */
    if (get_wp_vers() < '2.3') $ptype = '';
    else $ptype = " AND post_type = 'post'";

    $numposts = $wpdb->get_var("SELECT COUNT(*) FROM ".$wpdb->posts." WHERE post_status = 'publish'".$ptype);
    if (0 < $numposts) $numposts = number_format($numposts);
    $numposts = preg_replace("','", '', $numposts);

    It seems it is already set as $numposts

+ Reply to Thread

Similar Threads

  1. Review my article!
    By gptsven in forum Review My Site
    Replies: 2
    Last Post: 12-17-2009, 12:31 AM
  2. Replies: 0
    Last Post: 10-26-2009, 02:33 PM
  3. article
    By aismine in forum Off Topic
    Replies: 10
    Last Post: 07-30-2009, 03:02 AM
  4. cant add article in joomla
    By dhruv227 in forum Scripts & 3rd Party Apps
    Replies: 0
    Last Post: 05-26-2009, 01:23 PM
  5. [OFF] [10 Credits] To Comment on any article
    By TPI007 in forum The Marketplace
    Replies: 2
    Last Post: 02-26-2009, 12:14 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers