最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

How to use Disqus for some categories, and FB comments for others?

matteradmin4PV0评论

I didn't find anything related to what i'm trying to do.

My WP blog have several categories. For one specific category, in which I publish short news and viral content, I'd like to use Facebook comments as the default commenting system.

For any other categories, i'd like to keep using Disqus as usual.

My problem : since Disqus is taking over with a hook (I guess), how can I have Facebook comments take over instead of Disqus if in_category(x) ? Where would that happen, and how would you do ?

(Ideally, i'd like to deal with it in functions.php instead of having to edit core Disqus plugin files)

I didn't find anything related to what i'm trying to do.

My WP blog have several categories. For one specific category, in which I publish short news and viral content, I'd like to use Facebook comments as the default commenting system.

For any other categories, i'd like to keep using Disqus as usual.

My problem : since Disqus is taking over with a hook (I guess), how can I have Facebook comments take over instead of Disqus if in_category(x) ? Where would that happen, and how would you do ?

(Ideally, i'd like to deal with it in functions.php instead of having to edit core Disqus plugin files)

Share Improve this question edited Jul 22, 2013 at 15:16 Baptiste asked Jul 22, 2013 at 15:10 BaptisteBaptiste 34 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Do you need to use the Disqus plugin? ie are you synchronising with Wordpress comments (own your own comments etc). If not, it's easier and quicker to remove the plugin and just edit the comments.php file (the actual file depends on your theme but this is the most likely one).

This answer has the Disqus javascript code and you can get the Facebook code from Facebook's Developer Site, and then simply do an if-else with in_category(..) as the condition.

Post a comment

comment list (0)

  1. No comments so far