CM Answers (CMA) - Theme - Advanced - How to Change Plugin Theme Template
How to Change CM Answers Theme Template
This feature requires experience with CSS and PHP.
Why Do It?
CM 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
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.
Under the Miscellaneous section, mark Support overriding as yes. This will make the plugin apply the custom templates if they are found available.
You can also disable the app.css to include your own css file instead.
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
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.
The end result should be this:
The directory structure must be (active theme)/CMA/answer.
Different letter cases such as /cma/Answer will not work.
Now you can edit the files index.phtml (for Questions) single.phtml (for Answers). This requires experience with CSS and PHP.
The example from the start of the article includes these simple changes to the index.phml file:
Learn more about editing templates General Support - Advanced - Creating and Editing Custom Templates