WordPress Questions and Answers (CMA) - Theme - Advanced - How to Change Plugin Theme Template


How to Change Plugin Theme Template

Back to User Guide

Learn More

This feature requires experience with CSS and PHP. 

General Support - Advanced - Creating and Editing Custom Templates

Video Use-Case

Why Do It?

The WordPress Questions and Answers allows you to change your index and thread pages template while continuing to upgrade versions of the plugin. This gives you complete control over those pages.

Really Simple Example Of Changes

Example of simple changes - WordPress Discussion Forum
Example of simple changes

Required Plugin Settings

Some settings are required in order for the plugin to search and apply the custom theme.

Under the Appearance tab, set the template as CMA default to the pages where you will apply the custom theme.

Settings for choosing templates for index and thread pages - WordPress Q and A Plugin
Settings for choosing templates for index and thread pages

Under the Miscellaneous section, mark Support overriding as Yes. This will make the plugin apply the custom templates if they are found available.

Enabling support overriding - Discussion Forum Plugin for WordPress
Enabling support overriding

You can also disable the app.css to include your own css file instead. 

Disabling app.css - WordPress Question and Answer Plugin
Disabling app.css

Instructions

First, let's find the relevant files to be copied. They are located under wp-content/plugins/cm-answers-pro/views/frontend/answer. Copy:

  • index.phtml (for Questions)
  • single.phtml (for Answers)
  • meta folder
  • widget folder
Files of the plugin front-end templates - WordPress Forum Plugin
Files of the plugin front-end templates

Now create the sub-directory “CMA/answer” inside your current theme directory. It should be under wp-content/themes/(active theme)/

Then, paste the files and folders there. 

End Result

The end result should be this:

Adding plugin templates to the site theme - WordPress Discussion Forum
Adding plugin templates to the site theme

Case-Sensitive

The directory structure must be (active theme)/CMA/answer.

Different letter cases such as /cma/Answer will not work.


Editing Files

Now you can edit the files index.phtml (for Questions) single.phtml (for Answers). This requires experience with CSS and PHP. 

Example

The example from the start of the article includes these simple changes to the index.phml file:

Editing the template of the index page - WordPress Q and A Plugin
Editing the template of the index page

Learn more about editing templates: General Support - Advanced - Creating and Editing Custom Templates


More information about the WordPress Questions and Answers plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.