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.

1 Comment

  1. My WP Theme uses custom pages title which is specified within the page options as shown in the picture here:
    https://i.ibb.co/d2rQPq6/1.png
    ——
    the AnsPress is interfering with the theme, means the title style has been changed ever since I created the pages for AnsPress,
    ——
    * Here’s how normally the title is shown overall pages:
    https://i.ibb.co/9hXrmvk/2.png

    * and here’s how it’s shown on the index page of AnsPress
    https://i.ibb.co/wzyDyff/3.png
    ——
    Please, can you tell me how to solve this?
    Thanks in advance,

    Reply

Leave a Reply

Your email address will not be published.

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

Add your comment