Overriding and customizing AnsPress

AnsPress is very focused on “developer friendly”. Its internal structure allows developer to easily override anything they want. It have vast numbers of hooks to let developer customize internal functions. All documentations for hooks can be found here: Hooks. Everything inside templates folder can be easily overridden by following below steps.  Avoid directly editing AnsPress files in plugin directory because you’ll loose all change while updating.

Override folder

  1. Create a folder called anspress inside your active theme. It can be child or parent theme.
  2. Now you can copy files you want to modify from wp-contents\plugins\anspress-question-answer\templates\.

You must keep the same directory structure if you are modifying sub folder item. Like if you want to modify templates\css\overrides.css then in your override folder it should be anspress\css\overrides.css.

Overriding CSS

For adding or overriding AnsPress styles we suggest to use overrides.css. This file is initially left blank so you can add your own styles here.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment