i have install crayon plugin and my question is Why syntax highlighter working for questions but not for answers . please see the image
even u can try to post any test code question or answer on googez.com site ( sorry to post my dev site here)
Hej Rahul,
AnsPress 4.1.5 – latest from master (2017-12-18)
The pagination in chosen category loads the first page, its works as it should on home page and tags. I have tested this on the demo>Categories>AnsPress. If the second or the first page is picked the same first page is reloaded.
Best regards.
There are two questions about that request from 2015 and there’s no answer.
Is it possible to make such a list, so users can view which questions they subscribed and they may deactivate it.
Please consider this as a future request.
I would like to add “top”5-10 related post by tag to the body of a page or endpoint.
Example, a product for sale may have a tag of a feature (wireless) , so I’d like to display a few suggested related questions at the bottom of the product page related to “wireless”.
Should I do custom code or can a widget be used in content, or is there a short code??
Thanks in advance.
Also: all image links are broken throughout the documentation pages
Hi,
As Rahul has already posted a FAQ about the same –
https://anspress.io/resources/faq/insertimport-questions-programmatically/
But it has some open issues, which I have already asked in another question. Here, I am writing my work around using the same FAQ to import/insert questions/answers programmatically.
Inserting/importing question is quite easy, as the core function is already been adapted for it. So it’s pretty much same as mentioned in FAQ. Only additional thing I did was to insert/update qameta
and activity
on asking new question.
However inserting/importing answer gave me a headache, as its core function require some modifications, to use it out of the box. Some of the code blocks from function submit_answer_form
, which is causing issue are –
`$question_id = ap_sanitize_unslash( ‘question_id’, ‘r’ );`
`$form->save_values_session( $question_id );`
`if ( $form->have_errors() ) {…}`
So I created a new custom function in my child theme, which is nothing but the same as submit_answer_form
but tweaked it as per my use (in short, I provided parent_id
for the answer in the function args
).
I can’t seem to be able to embed gist code here (maybe anyone with access can edit this post and embed it), following is the link of function which one should add in his child theme’s functions.php
https://gist.github.com/atultiwari/53471873ac622b2cf039efebf897c2b5
Following is the link for function, which can be used/modified for inserting/importing question/answer programmatically (please note that, for my usage I needed multiple tags, so I created an array for it named `$anspress_tags_id` in the function)-
https://gist.github.com/atultiwari/29ddff5fa59c97153061d3068db1531f
P.S. – I used latest master build (dated 18-12-2017) for it and I am no programmer, just reverse programmed (sort of) the codes which was already posted by Rahul.
@Rahul, please have a look at it in your free time and provide suggestion, how can I improve it?
Thanks
Regards,
Dr. Atul
I’m facing this issue from past 1-2 weeks tried a lot but couldn’t fix it. Please Help
When Autoptimize’s Optimize JavaScript Code? is checked, the Ask page may fail to load the i18n texts for the AnsPress TinyMCE buttons: Insert image and Insert code.
Workaround:
Using Autoptimize Options, exclude js/tinymce/plugins/compat3x/plugin.min.js from Autoptimize
On Autoptimize, when Optimize JavaScript Code? is checked, AnsPress’ Ask page may fail to load TinyMCE.
Workaround:
Using Autoptimize Options, exclude js/tinymce/tinymce.min.js from Autoptimize.
iam trying to install Styles plugin to easy manage the colors of menus and Texts on the firebug theme but its doesn’t show under apparence / Cutomize
How to solve that ?
When a website visitor is using “Search” for searching all questions, rather than displaying the results from their specific search the content below is just the list of all results.
Also, I see that Ans 4.1.5 is out, but WP repository doesn’t show that it isn’t available?