====== Guide: How to add Disqus comment system ====== This guide shows how to replace FlatPress' default comments with the Disqus comment system. It was originally provided by Tongara [[https://forum.flatpress.org/viewtopic.php?f=2&t=123#p286|on the support forum]]. Thank you very much, Tongara! Please refer to the forum if you have suggestions or questions regarding this guide. ==== The Basics ==== The following assumes you already have a Disqus site created, and you've got your Disqus Universal Code ready. If not, please visit https://disqus.com/profile/signup/ and do that first. First things first, we're going to be using the leggero default theme, but this can be done with any theme at all. Go ahead and open up your theme's "theme.conf.php", and underneath the line that says\\ ''"$theme ['default_style'] = leggero';"'' You should add the following:\\ ''$theme['hassingle'] = true;''\\ That will make sure your blog entries are now displaying as their own entries on their own single page permalinks, which is a must imo. It took me a good HOUR to find that line of code, and I randomly found it on a flatpress news update about "FlatPress 0.804 Vivace" from all the way back in May 2008 (!!!!), which can be seen [[https://www.flatpress.org/2008/05/07/flatpress-0804-vivace|here]]. I really think it should be added to the wiki's general knowledge on Flatpress. Anyway, back to the guide... Now you're going to want to make a new file in the same directory called "single-default.tpl", and you're going to want to copy the contents of your "entry-default.tpl" like so, and then we're going to paste that into our newly created single-default.tpl:\\
{* using the following way to print the date, if more *} {* than one entry have been written the same day, *} {* the date will be printed only once *} {$date|date_format_daily:"

`$fp_config.locale.dateformat`

"}

{$subject|tag:the_title}

{include file=shared:entryadminctrls.tpl} {$content|tag:the_content}
Now we need to do some editing! Find the following code {if !(in_array('commslock', $categories) && !$comments)} {/if} Delete that code, and then underneath the simply in your Disqus universal code, like below:

{literal} {/literal}
Remember to change "YOUR-SITE-PAGE.URL/YOUR-PAGE.php" to your flatpress blogs address, change "YOUR-DISQUS-SITE-NAME" to the shortname of your disqus site, and to change the identifier to whatever you like, or make it blank, it's up to you. You can obviously place this where is best suited in your own code if your theme doesn't contain a