Hello. On my website I limit users with ability to post 2 articles.
I’m using code in functions.php
// LIMIT number of posts per user
function post_published_limit( $ID, $post ) {
$max_posts = 2; // change this or set it as an option that you can retrieve.
$author = $post->post_author; // Post author ID.
$count = count_user_posts( $author, 'post'); // get author post count
if ( $count > $max_posts ) {
// count too high, let's set it to draft.
$post->post_status = 'draft';
wp_update_post( $post);
// add here
// $redirecturl = get_post_type_archive_link( 'property' );
wp_redirect( site_url('/limit-2-maximum/' ));
exit;
// end here adding
}
}
add_action( 'publish_post', 'post_published_limit', 10, 3 );
// END LIMIT number of posts per users
My question: is there a way to utilize this code snippet to limit the number of Questions and/or Answers a user (member) can post?
Thank you.
PS just an amazing plugin, for sure!
Insert Image Not working when Quick Tag Editor is Enabled Sir Please check, I turned off this then I got Insert Image options working and I am not getting Tags Autocomplete option, what I should do to get it.Thanks You Rahul Sir
Hi Rahul Sir ,So much thanks to you for making this great plugin.Sir I have a small issue. I enabled tag addon, added 6 sample tags. still autocomplete is not working in when i tried to add in Ask Question page every time it tell to create the tag what we typed in input box.also when I tried to add tag thorugh Tag under Anspress i can See only Loading, when I refresh the page I can see tag been added . Please tell me what is wrong with me Thanks
Hello. Amazing plugin…but it’s not working for me.
Basically, when posting Question, it lands on a blank page (think WSD error 500 page – found in Inspection Tools), inspection tools shows that the url isn’t available.
It also happens anytime you try to go to the actual single page with Question.
Everything else works (profile, tags, list of Questions, add-ons, etc.)…just not the actual page with Question on it.
I check permissions, I tried debugging (WP Debug, php error logs, etc.), but can’t find any issue.
Any other suggestions?
Thank you so much, I really hope this works.

I wish to have the “Quick Edit” option while moderating the answers. Is there any way to enable it? Currently, it shows only Trash, Edit, and View.
Hi,
I want to make the interface for my question page much simpler. I want to remove the answer box as well as the search box on the question page. Is this possible?
Would greatly appreciate help.
Hey there! I recently exported and imported my questions and answers into a new website. Now, I can’t get the answers to line up with the questions.
I have tried running all of the tools in the options section, but still can’t get it to work. I realize it is because the parent post isn’t identified, I found this out from another post. The person went into their database and updated everything manually. I really don’t want to do that as I have a bunch of questions.
Anyone else have this problem and how did you go about fixing it?
Does Askbug theme require Anspress plugin for QA?
If no, then are you planning to bring any update to the AskBug theme?