PHP Deprecated: Non-static method AnsPress_Category::column_header() should not be called statically in /home/wp-includes/class-wp-hook.php on line 298
Can we easily add education, work and other fields? What about dynamic fields with autosuggest across hundreds of rows of data?
Hi,
I am working with Anspress and an Askbug-child and I have a problem with the count of answers displayed in the header of the question which is blocked on 1. This must come from the following code ($ans_count and 3rd echo)
<?php $ans_count = ap_question_get_the_answer_count(); $last_active = ap_question_get_the_active_ago(); $total_subs = ap_question_get_the_subscriber_count(); $view_count = ap_question_get_the_view_count(); $last_active_time = ap_human_time( mysql2date( 'G', $last_active ) ); echo '<span class="ap-display-meta-item"><span class="stat-label apicon-pulse"></span><span class="stat-value"><time class="published updated" itemprop="dateModified" datetime="'.mysql2date( 'c', $last_active ).'">'.$last_active_time.'</time></span></span>' ; echo '<span class="ap-display-meta-item"><span class="stat-label apicon-eye"></span><span class="stat-value">'.sprintf( _n( 'One time', '%d times', $view_count, 'anspress-question-answer' ), $view_count ).'</span></span>' ; echo '<span class="ap-display-meta-item"><span class="stat-label apicon-answer"></span><span class="stat-value">'.sprintf( _n( '%2$s1%3$s answer', '%2$s%1$d%3$s answers', $ans_count, 'anspress-question-answer' ), $ans_count, '<span data-view="answer_count">', '</span>' ).'</span></span>' ; echo '<span class="ap-display-meta-item"><span class="stat-label apicon-users"></span><span class="stat-value">'.sprintf( _n( '1 follower', '%d followers', $total_subs, 'anspress-question-answer' ), $total_subs ).'</span></span>' ; ?>
Please note that the count of answers displayed below the question (on top of the answers list, shown herebelow) is working properly;
<?php printf(
_n('%s%d%s answer', '%s%d%s answers', ap_answer_get_the_count(), 'anspress-question-answer'),
'<span data-view="answer_count">',
ap_answer_get_the_count(),
'</span>'
);
?>
Could you please help me adapt the first code?
Many thanks in advance for your help,
Sincerely,
Thierry
Hi, Thank you for a great Q&A. My WP Edit does not integrate all the way with AnsPress. The key function for me is the equation editor and it’s there but using it results in the latex code instead of forcing the image of the formula. I appreciate your help.
For example, I have 16 questions with a tag. The first page shows 10 questions as I have set it in the options. Now, The next page link [page 2] shows that same page again. though the url changes.
You can check it here
englicist.com/questions/tag/the-inchcape-rock
Please look into it and suggest a fix.
Hello
Once you click on a question, page trying to be loaded but not open the page the question, but returns to the main page with all the questions
What is the reason this failure?
———-
Here’s a link
Thank you for answering my previous question about adding Latex capabilities in questions.
There is only one more feature I would like to make anspress perfect for me. I would like a “dynamic preview” of the latex entered into the text editor.
This “dynamic preview” is a feature for users writing questions (and answers) on the Q&A sites mathoverflow.net and math.stackexchange.com. I’m trying to mimic these sites for my classroom.
Here is what I mean, currently when a user enters a question in anspress with latex they’ll see
What I want is the text to be captured and echoed onto the screen, something like what’s in the next image:

Now, it doesn’t have to be in that position, just as long as the user can see it when they are typing would be perfect.
Previously I had been using wpmu’s Q&A (https://github.com/wpmudev/qa) which is no longer being worked on. The “dynamic preview” was accomplished by entering
add_action( 'after_setup_theme', 'omega_theme_setup' );
function add_qa_script(){
?>
<script>
jQuery(function ($) {
if (typeof(tinyMCE) != "undefined") {
tinymce.on('SetupEditor', function (editor) {
if (editor.id === 'answer') {
// Could use new 'input' event instead.
$("<div id='live-type' style='margin:20px 0px'></div>").insertAfter("#edit-answer");
editor.on('change keyup paste', function (event) {
$("#live-type").html(this.getContent());
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"live-type"]);
});
}
if (editor.id === 'question_content') {
$("<div id='live-type' style='margin:20px 0px'></div>").insertAfter("#ask-question");
editor.on('change keyup paste', function (event) {
$("#live-type").html(this.getContent());
MathJax.Hub.Queue(["Typeset",MathJax.Hub,"live-type"]);
});
}
});
}
});
</script>
<?php
}
add_action( 'wp_footer', 'add_qa_script', 100 );into the themes functions.php file.
Is there an easy way to accomplish the same thing with anspress? Thank you very much.
Not sure if this is normal or not. I installed over v4b1.
WordPress database error Table ‘wp_ap_meta’ doesn’t exist for query SELECT SQL_CALC_FOUND_ROWS * FROM wp_ap_meta WHERE apmeta_type = ‘reputation’ LIMIT 50 made by do_action(‘wp_ajax_ap_migrator_4x’), WP_Hook->do_action, WP_Hook->apply_filters, AnsPress_Admin_Ajax::ap_migrator_4x, AP_Update_Helper->__construct, AP_Update_Helper->migrate_reputations
Hello Friends,
I have released 2nd beta of 4.0. You can easily upgrade from 3.x to 4.0.Please give it a try and let us know what you think about it.

Thanks.
Download link:
Hi there,
Not sure this is a question or it contains its answer.
Still working with Anspress Q&A 3.0, I noticed that the following strings are not translated although some seem presented in the po file:
In the comment form
- There aren’t any comment yet (not in po file)
- Your comment.. (in po file)
- Submit (in po file)
- Cancel (in po file)
These three strings are located in the plugins/anspress-question-answer/theme/default/js-template/comments.html. I made the change manually but I need to remember it at next update (unless sbd knows where/how to set the modified file in my child-theme)
In the answer display
- Posted (in po file)
This is coming from <?php ap_answer_the_time(); ?> located in answer.php… I took it off and set the reviewed answer.php in my theme/child-theme/anspress directory. It works but I d prefer to show the answer date, even better with the time (if anybody knows how to adapt the function, I ll be happy too)
I hope this will help newbies working with old APQA and developpers working on the new APQA.
Sincerely,
Thierry