Forums

post count plugin - how to subtract 1 (3 posts)

  1. loftyfinds
    Member
    Posted 3 years ago #

    I'm using the http://wordpress.org/extend/plugins/post-count/ but the count is over by one. I image it's because the first post the wordpress gives you when it's installed. I deleted it instead of just modifying it.

    How can I modify the post count plugin to subtract one. It probably really easy for someone that knows what there doing.

  2. MopeyGecko
    Member
    Posted 3 years ago #

    Are you sure the count is wrong. All that plugin is doing is counting the number of rows in the posts table in the database so long as the row is post is set to published. Deleting a post removes the row entirely so deleting the post like you say you have done should indeed reduce the count.

    In any case if you really do want to reduce the count by one you need to open up post-count.php and change...

    SELECT COUNT(*) FROM

    to...

    SELECT COUNT(*)-1 FROM

  3. loftyfinds
    Member
    Posted 3 years ago #

    Perfect thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.