I have a need to use the template file single-dwqa-question.php to handle the templating of my single questions pages. I have some stuff on my single.php that is appropriate for single blog posts on the site, but not for single question pages. I created single-dwqa-question.php based on the standardized rules for WordPress template hierarchy. However, single questions continue to be displayed using single.php.
I have it working fine with another custom post type, but that CPT uses and underscore instead of a hyphen in the custom post type name. I’m wondering if that has something to do with it. Hiding the extra content via CSS is not the preferred way to handle this and I would rather do it through WP’s templating system.
Can you please advise on this?
Hi Peter, As you can see in the templates folder of DWQA ( https://github.com/designwall/dw-question-answer/tree/master/inc/templates/default ) we have all element templates here, so please create a dwqa-templates folder in your theme folder then copy any files which you want to edit from <your-plugins-directory>/dw-question-answer/inc/templates/default to <your-theme>/dwqa-templates/ .
For the PRO version…
I just got it this override working with the paid version of the Q&A Plugin. I had to put the files in a slightly different directory as the files for that are in a different location.
I put the “content-single-question.php” in there and it seems to be overriding fine.
Please login or Register to submit your answer