Fix WordPress comment count error caused by Disqus plugin

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading...
May 28, 2011

Disqus for WordPress is a great plugin for those who want to integrate a better way of adding comments to their blogs. With Disqus, you can allow your visitors to easily post comments through their Facebook or Twitter accounts. Disqus perfectly syncs with WordPress comment system and the comment on your database is also synced with Disqus’ server. But with the latest version of WordPress i.e. WordPress 3.1, Disqus has some issues showing the comment counts for the post. Here is how you can fix comment count error in WordPress 3.1 when Disqus plugin is used.

After upgrading to WordPress 3.1, you would encounter a strange error in the post list area instead of the comment count. This would happen only if you have Disqus plugin for WordPress installed. The error looks something like this:

Warning: number_format() expects parameter 1 to be double, string given in /wp-includes/functions.php on line 155

Disqus comment system

This error occurs because Disqus’ comment count system uses its own value for counting comments that breaks WordPress’s default function number_format_il8n(). This function expects the comment number value to be a double instead of a string. So, we’ll have to edit a file on Disqus plugin folder.

Open the file /wp-content/plugins/disqus-comment-system/disqus.php. Now find the following line of code on your text editor.

[code]function dsq_comments_number($count)[/code]

Your code will look something like this:

[code]
function dsq_comments_number($count) {
global $post;

if ( dsq_can_replace() ) {
return ‘<span class="dsq-postid" rel="’.htmlspecialchars(dsq_identifier_for_post($post)).’">’.$count.'</span>’;
} else {
return $count;
}
}
[/code]

Simply replace the above code with the following.

[code]
function dsq_comments_number($count) {
global $post;

return $count;
}
[/code]

This will do the trick to fix error in comment count on WordPress 3.1 due to Disqus plugin.

You may also like...

  • Anonymous

    Thanks so much for this! I’ve just spent an hour trying to fix it as realised it broke after upgrading.

  • Anonymous

    you’re welcome 😉

  • considering ditching disqus to use comment love and wordpress supported comments. pros? cons?

  • Anonymous

    disqus is the best option.

  • garth ethan

    Well, This is good and interesting software review.

    SoftwareEngineer

  • Anonymous

    😛

  • well i have face the same problem but rectified it by re-installing the plugin

  • Anonymous

    the latest version fixes the issue.

  • Anonymous

    actually disqus makes commenting more easy as people can easily comment to
    your blogs using twitter or facebook accounts.

  • Generic Viagra

    Ditching Disqus considering the use of love comments and WordPress supported comment. pros? disadvantages?
     
    Kamagra
    Kamagra

  • 年 冯

    A wide range of Australian made UGG Boots and sheepskin leather products. Supra Shoes on hot sale now,we carry a large inventory from Supra Footwear, Including Supra Shoes,Supra Skytop And Supra Avenger,Supra Bandit,Supra Bullet.Huge Range, all with Fast, Free Delivery.
    Bryant, the gap in the purchase price of shoes in kobeshoes.cc! Zoom discounts and cheap to buy the lowest price every day Kobe Shoes.Huge Puma Trainers Range at LQshoes Massive Sale Now On. Free Delivery to UK USA Canada… Buy Cheap Puma Shoes at Puma Shoes Online Store Now!Wholesale Authentic NFL Jerseys,Contain mens,womens and youths Cheap NFL Jerseys,Welcome to buy.Inc sell cheap Sunglasses,is a Oakley Sunglasses reseller store, Oakley NFL eyeglasses are sold as a cheap price.!NFL Cap.

  • Accelerated Learning

    Disqus is easy to use and it has the tagging feature. So Disqus is okay to use.

  • i am using it. it is really easy to use

    [URL=”http://www.momentumblades.com/”]

    Oscillating Saw Blades[/URL]
     

  • This article adds to my knowledge
    by
    Pengertian Amazing

  • goodman

    My name is Patrician Soon ,am from Malaysia but i work and live Singapore last Month i was in need of loan ,and i contact two loan companies where i got ripped off over $3,000 SGD and i swear never to involve myself in such a sleazy game again until a good friend of mine in Singapore Susan Lim referred me to a very reliable loan company .i just applied for a loan of $40,000 SGD in less than 4hrs and my loan was approved and transfers to me so am using this medium to referred all loan seekers to this loan company. you can reached them by email honestloan10@gmail.com

  • goodman

    Hello:
    Need urgent loan to solve your financial needs, we offer reliable loan at an interest rate applicable to all loans is (3%), if you are interested contact us via (honestloan10@gmail.com) with the information below
    Your full name: _____
    Country: _____
    City: _____
    Address: _____
    Amount Needed: _____
    duration: _____
    Loan Purpose: _____
    Monthly income: _____
    Age: _____
    Sex: _____
    Occupation: _____
    Telephone number: _____
    Thanks.
    Mr Marsha Goodman

  • goodman

    I am a private loan lender which have all take to be a genuine lender i give out the best loan to my client at a very convenient rate.The interest rate of this loan is 3%.i give out loan to public and private individuals.the maximum amount i give out in this loan is $1,000,000.00 USD why the minimum amount i give out is 5000.for more information contact us email honestloan10@gmail.com
    Your Full Details:
    Full Name :………
    Country :………….
    state:………….
    Sex :………….
    Address…………
    Tel :………….
    Occupation :……..
    Amount Required :…………
    Purpose of the Loan :……..
    Loan Duration :…………
    Phone Number :………
    Contact email:honestloan10@gmail.com

  • APPLY FOR A LOAN

    A bad credit history shouldn’t deter you from reaching out to a loan company if you are need of fast approval for a cash loan. Securing a fast cash loan when you have bad credit isn’t out of the question if you know who to turn to when financial times are tight. With so many consumer finance companies from which to choose from, make sure you choose a lender that has an established reputation. At Citizens Savings & Loan, we have been in the business of making loans to individuals of doing business, we have worked with a myriad of personal financial needs and have helped countless individuals reach their financial goals. contact us: ( sbifinancelive@hotmail.com )

  • APPLY FOR A LOAN

    When your financial situation gets out of hand and when friends and family not in a position to help you out, you turn to banks. When your not so fabulous credit report fail to give you a helping hand, Get the cash you need today! Unexpected expenses can arise at just about any time. This is when a personal loan can come in handy. Often times you can apply for no credit check personal loans online. Unlike some companies we work with hundreds of lenders to match you up with the loan that meets your needs. We have the ability to offer no credit check loans contact email: ( apply98@outlook.in )

  • APPLY FOR A LOAN

    A bad credit history shouldn’t deter you from reaching out to a loan company if you are need of fast approval for a cash loan. Securing a fast cash loan when you have bad credit isn’t out of the question if you know who to turn to when financial times are tight. With so many consumer finance companies from which to choose from, make sure you choose a lender that has an established reputation. At Citizens Savings & Loan, we have been in the business of making loans to individuals of doing business, we have worked with a myriad of personal financial needs and have helped countless individuals reach their financial goals. contact us: ( sbifinancelive@hotmail.com )

  • APPLY FOR A LOAN

    Are you looking for a very genuine loan?
    Do you want financial assistance in your business?
    Do you want to buy your dream house and car?
    Do you want to start up a business and you dont know where to start from?
    Have you been turned down constantly by your banks and other financial institutions? worry no more because we give out loan At an affordable interest rate of 3%? Processed within 24 hours.and a repayment duration period of 1year to 30years to any part of the world.We give out loans within the range of 1,000 to 100,000,000 USD contact us: ( sydef@outlook.com )

  • APPLY FOR A LOAN

    i need a loan

  • Trimak Loan

    TESTIMONY ON HOW I GOT MY LOAN TO PAY MY BILLS My name is Anita Holloway. I live in USA California and i am a very happy woman today? I told my self that any Loan lender that could change my Life and that of my family, i will refer any person that is looking for loan to Them.They gave happiness and my family, i was in need of a loan of $250,000.00 to start my life all over as a widow with 2 kids I meant this honest and GOD fearing loan lending company online that helped me with a loan of $250,000.00 U.S. Dollar, They are indeed GOD fearing People, A reputable loan company. I am very happy i got loan from Trimak loan today just within 48 Hours. If you are in need of loan and you are 100% sure to pay back the loan please contact them and please tell them that Mrs, Anita sent you to them. contact via E_mail: trimakloanfunds@gmail.com

  • Matricia

    LOAN TESTIMONY OF HOW I GOT LOAN FROM A LEGITIMATE MONEY LENDER
    Hello Everyone, My names are Mrs Marticia Simons, i am from the United States of America, currently living in Oklahoma.i went in search for a loan on the internet , and the Lord lead me to a genuine loan lender, A Company of Fidelity Loan FInance.fidelityloanfinancial(AT)gmail(DOT)com, whom i contacted and requested for a loan amount of $45,000.00 dollars to establish a new business, and to my surprise i got my desired loan within 2 days(48 hours). While searching for a company to get a loan from, i read various testimonies of how people where scammed of their money,and i was scared.I am happy i came in contact with FIDELITY LOAN FINANCE.so i humbly advice you in search of a genuine loan lender to quickly contact FIDELITY LOAN FINANCE via email:fidelityloanfinancial(AT)gmail(DOT)com and you will be as happy as i am.may the good lord bless them and reward them effortlessly for what they have done in my life. Indeed they are the best loan lenders.

  • mr Aderson

    We represent a Funding Source that shares the desire to engage in the high-risk, high-return potential business of “investment financing . Universal Loans is making large ring around the globe with the online finance, we provide capital to entrepreneurial companies and serious individuals who seek to make investments in the area of infrastructure and construction development such as Personal Loan, Business Loan, Mortage Loan, House Loan, or any kinds of loan required.
    We grant personal and Mortgage loan our interest rate is affordable at the rate of 2%. Our career has been built around leading and developing investments and projects, from ideal to successful launch and target driven performances. I urge you to come up with the detailed plan of any loan you would want us to finance. Email us for more info: brianjacksonhouseofloans@gmail.com.

  • Karen Kesby

    Good Day,

    My name is Christine Holland i am a citizen of the United State of America i want to testify of the good Loan Lender who showed light to me after been scammed by 4 different Internet international lender, they all promise to give me a loan after making me pay a lot of fees which yield nothing and amounted to no positive result. i lost my hard earn money and it was a total of 8,000USD. One day as i was browsing through the internet looking frustrated when i came across a testimony man who was also scammed and eventually got linked to a legit loan company called Brooks Finance Loan (brooksfinanceltd@gmail.com) where he finally got his loan, so i decided to contact the same loan company and then told them my story on how i have been scammed by 4 different lenders who did nothing but to course me more pain. I explain to the company by mail and all they told me was to cry no more because i will get my loan in their company and also i have made the right choice of contacting them. i filled the loan application form and proceeded with all that was requested of me and I was given a loan amount of $600,000.00 Dollars by this great Company (Brooks Finance Loan) managed by Mr Brooks Henry and here i am today happy with my family because Brooks Finance Loan has given me a loan so i made a vow to my self that i will keep testifying on the internet on how i got my loan. Do you need a loan urgently? kindly and quickly contact Brooks Finance Loan Ltd. now for your loan via email: (brooksfinanceltd@gmail.com) i believe other people are also giving testimony on this same honest lender.