AnsPress Plugin with X Pro (Integrity Stack)

Hi. I am using X Pro and am having an issue with AnsPress displaying properly. I know this is theme related, as if I switch to TwentySeventeen, the pages work as intended.

As an example - https://www.phenomlab.com/comminuty/category renders correctly, but anything underneath just shows a blank page (created with Cornerstone in both cases). I think I’ve tracked this down to the page.php template. As an example, TwentySeventeen works fine, whilst wp-page.php in the X Pro theme doesn’t seem to work at all

I’m using a child theme, so have also been playing around with copying templates and modifying them. However, I am not sure I completely follow how X renders content. Essentially, even /community works correctly, but the above pages do not. I realise that this isn’t very clear, so in order to determine how the pages should be rendered, here’s an example from the plugin author’s site

https://anspress.io/questions/categories/updates/

As you can see, this works fine on their site, and also works if I switch themes. However, it will not work at all in X Pro (under any stack). I don’t really want to switch themes having paid for a brilliantly designed theme like this, and wondered if there was a workaround that someone could suggest ?

PS - I am actually a developer, so feel free to use “geek speak” :slight_smile:

Hey @phenomlab,

The AnsPress plugin has not been tested with Pro so we could not guarantee its compatibility with it.

I checked your community category and it looks like you’ve inserted AnsPress content or shortcode inside a Text element. Have you tried inserting it in the default WordPress Text editor? If so, what is the result? Answering that will help us understand if it isn’t compatible with the Content Builder only.

When you switched to another theme, are you still using the community category page for testing or did you test a different page? Because if you’ve tested the same community category page, you’ll see the Content Builder’s shortcodes. Please give us more details about your setup and how we can replicate the issue you’re facing.

Please see our customization best practices and that will also help you understand how X/Pro templates work.

Thanks.

Thanks for the response - appreciated. I’ve used a default wp page to display the shortcode of [anspress] but this has the same result, so I don’t think it’s cornerstone. I used the same URL in testing, so no changes there.

You can replicate this easily by

  1. Installing AnsPress 4.1.0 from AnsPress.io or from their git repository (master branch)
  2. Configure AnsPress options so that each page is defined - in my case, categories, archives, tags, etc.
  3. Go to the addons tab and enable categories and tags
  4. Create a new test question
  5. Assign a category or tag to it
  6. Open the question when created
  7. When the question is open, click the tag or category shown at the top which will replicate the issue - no content is loaded

AnsPress had been tested with multiple themes and works with no issues - except X. I’ve been in contact with the developer of this theme who informed me that X is overwriting the rewrites from AnsPress. An extract of that discussion is below

"sorry but this cannot be solved. This bug is generated by theme 100%.
category main query look like this:
AND wp_posts.post_type IN ('post', 'page', 'attachment', 'essential_grid', 'x-portfolio')
but it must be like:
AND wp_posts.post_type = 'question' can be in statment but with question cpt.

as you can see now, theme or may other plugin completely overriding core WP functionality."

It’s not the plugins. If I switch to TwentySeventeen, everything works as expected. I thought that perhaps I could add these post types to cornerstone, but they are not listed as available.

I found a function that permits the addition of post types but can’t get this to work either. Note, that this issue persists regardless of stack - I’m using integrity.

I have a staging site at https://dev.phenomlab.com which I can give you access to. Essentially, it’s a pre-made replica of the live environment with testing tools (query and rewrite monitor) enabled.

I’d really like to get this fixed asap - let me know if the dev site access will speed this process up, and I’ll get a login over to you.

Thanks

Hi there,

Your provided URL from their site as a sample is a taxonomy page, it’s not page nor even using a shortcode. Plus, the query they provided isn’t even related. They can’t force it to just include their preferred post type.

The issue here is the use of the template which they forgot to check. All taxonomy pages redirected to index.php and not page.php.

Could you try installing AnpPess to your staging and create samples? I just like to see its complete setup.

Thanks!

Hi Rad,

Thanks for the response. Unfortunately, I’ve elected to move away from AnsPress, as the new release is a bit of a mess to say the least. The staging site has been modified to reflect this, which is why you so not see the expected results.

As I won’t be proceeding, this request can be closed.

Thanks

You’re welcome.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.