Blue Presley
asked 8 years ago

I’m having a lot of trouble with DWQA template files not working with certain themes.
For example, the theme I am using now is called BuddyBoss, and it’s one of the most popular themes for BuddyPress.
DWQA uses a template scheme where many parts of the HTML file are spread across many different plugin files. For example, part of the html is included in PHP code (dw-question-answer.php, lines 603 to 612), content-start-wrapper.php, and content-end-wrapper.php.  This is so confusing.
Take a look at my current site home page (which is set up properly for DWQA) http://bluepresley.com/bbo/
buddyboss’ code overrides the code somehow and does not allow your theme template to be used (notice the /var/www/vhosts/bluepresley.com/httpdocs/bbo/wp-content/themes/buddyboss/front-page.php is the name of the template file being used, different from archive-question.php dwqa uses by default).
So now what do I do? I’m having so much trouble copying and pasting so much code from the 14 scattered files that make up the DWQA architecture. Why can’t we just have two simple templates that we can use or refer to as developers? – ask-question.php and list-questions.php (maybe 3 total if ‘? So many files just aren’t needed, and HTML certainly doesn’t need to be added through PHP function calls.
My question is this. I’ve included below the code for BuddyBoss front page.  Can you please tell me what code I need to enter, aggregated from all the template files, so that I can create one single template here that works with my BuddyBoss theme? More specifically, what code makes up the core functionality of the “list question” functionality, and then the same for the “ask question” functionality.
As a suggestion, I would like to even suggestion this – make it all a shortocode? How easy would that be? Something like this: [dwqa-ask-question max=”10″ pagination=”yes”] – Then we can place that in ANY template and it will just work. The current list quesiton shortcode is very close, but  needs options for pagination.
In any case, my code is below.
 
Thanks,
Blue

<?php
/*
*
* @package WordPress
* @subpackage BuddyBoss
* @since BuddyBoss 3.0
*/
get_header(); ?>
<div id=”primary” class=”site-content”>
<div id=”content” role=”main”>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( ‘content’, ‘page’ ); ?>
<?php comments_template( ”, true ); ?>
<?php endwhile; // end of the loop. ?>
</div><!– #content –>
</div><!– #primary –>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

2 Answers
well wisher
answered 8 years ago

i think here is the part you may need in start:

<div id=”primary” class=”site-content”>
<div id=”content” role=”main”><?php get_template_part( ‘content’, ‘page’ ); ?>

and here is the part you need in end wrapper:


</div><!– #content –>
</div><!– #primary –>
<?php get_sidebar(); ?>
<?php get_footer(); ?>

try eliminating just the footer line from end wrapper if this doesnt works

Blue Presley
replied 8 years ago

Thanks for the reply. Currently I’m having an issue where my theme will not allow DWQA to use archive-question.php as the home page template. Instead, it calls it’s own front-page.php, which is the code I posted. So, I can’t use the content wrapper files in the DWQA plugin, but instead I have to put the list question page logic from those files into my front-page.php template file.

well wisher
replied 8 years ago

did you tried something like :
copying things from archieve -question.php into your new template questions-page.php remember you have to create a new template and them copy the stuff into it now upload this new page template into your theme directory and then from wordpress post editor chose this template for your questions page

well wisher
replied 8 years ago

questions-page.php is just the name of php file you can name it anything you like the page template is created using these tags /*
Template Name: My Custom Page
*/
read more about it from here http://codex.wordpress.org/Page_Templates

BigHug
answered 8 years ago

Hi guys,
A good news is that we have improved this part of the plugin, and instead of using complicated template file, we will shortcode. We will soon release version 1.3.0 of the plugin that includes this significant improvement.

Powered by DW Question & Answer Pro