From version 1.4, Question2Answer offers out-of-the-box integration with your WordPress 3+ site and user database. To install Question2Answer as part of your WordPress site, please follow the instructions below:
Download the latest version of Question2Answer to your computer or web server (also available on GitHub).
Unzip the download using a tool such as WinZip (or unzip
in the Unix shell).
Find qa-config-example.php
and .htaccess-example
in the unzipped question2answer
folder, and rename them to qa-config.php
and .htaccess
, respectively.
Open qa-config.php
in a text editor and insert the following line next to another define(...)
in the file:
define('QA_WORDPRESS_INTEGRATE_PATH', '**/PATH/TO/WORDPRESS**');
Replace **/PATH/TO/WORDPRESS**
in the example with the full path to the WordPress directory on your server, i.e. the directory which contains wp-load.php
. You do not need to set your MySQL database details in qa-config.php
since these are imported from WordPress automatically. Q2A and WordPress will use separate tables within the same MySQL database.
http://www.mysite.com/qa/
), create the subdirectory inside the root directory for the site, then move or upload all the contents of the unzipped question2answer
folder into this subdirectory.http://qa.mysite.com/
), move or upload all the contents of the unzipped question2answer
folder into the root directory for that domain on your web server.http://www.mysite.com/qa/
under http://www.mysite.com/
) then nothing needs to be done.http://www.mysite.com/qa/
and http://www.mysite.com/blog/
), then add the following line at the start of the WordPress wp-config.php
file:
define('COOKIEPATH', '/');
http://qa.mysite.com/
and http://blog.mysite.com/
) then it’s a little more complicated:
Add the following lines at the start of the WordPress wp-config.php
file, replacing **.mysite.com**
with a period (.) followed by the partial domain name which is shared by both sites:
define('COOKIEPATH', '/');
define('COOKIE_DOMAIN', **'.mysite.com'**);
Add the following lines at the end of the WordPress wp-config.php
file, replacing **qa.mysite.com**
with the full domain name for your Q2A site:
/* To allow redirection from WordPress login to Question2Answer */
add_filter('allowed_redirect_hosts', 'qa_wordpress_redirect_hosts');
function qa_wordpress_redirect_hosts($content) {
$content[] = **'qa.mysite.com'**;
return $content;
}
http://www.mysite.com/qa/
http://qa.mysite.com/
Follow the on-screen instructions to set up your database and Question2Answer functionality.