Hi,
As you know, I am planning to start from scratch, which includes adding around 60,000 Q&A programmatically. Long back I wrote a raw script to add Q&A programmatically and posted on Anspress too –
https://anspress.io/questions/question/tutorial-how-to-import-questions-and-answers-to-anspress/
But a lot has changed since then. I wanted to know what are different metas consumed when a question or answer is posted, and more importantly How to update those in a fast way(using hard coding)?
I know you had earlier suggested to some user “ap_save_question”
https://anspress.io/resources/functions/ap_save_question/
which is deprecated now. Then I read about “submit_question_form”
https://anspress.io/resources/methods/ap_form_hooks-submit_question_form/
From here I got the basic idea. But it’s very difficult to reverse trace all the metas used by this function (and sub-functions). Also, there are parts which can Not be there when adding Q&A programmatically (such as redirect to newly posted Question).
So I need to make a new function, which will just add new question/answer and its metas.
For e.g, I have just striped a part (adding question programmatically) of script which I posted earlier –
https://gist.github.com/atultiwari/f99656c899d0f1faef9125d6b0db098c
Sorry, it seems I was not able to embed codes here, so added screenshot, for better understanding.
In the above e.g., I used wp_set_post_terms for adding category & tags.
Can this be used with current version of Anspress?
So far I can think of following metas, which are being used in posting Q&A –
- Category
- Tags
- Activities
- View counts
- Timestamp
But, I am not sure how to use these in my script?
Please share your inputs regarding this.
Thanks.
Regards,
Atul
Hi,
I am testing my Anspress installation and when I post a question when I am NOT logged in as a user I am redirected to a 404 error page. However, if I click on the question from my Anspress base page the page IS live.
If I am logged in to my WP account and post a question the redirect goes to a page that is live and doesn’t show a 404 error.
What is going on? How can I set it so non-logged in registered users will be redirected to a live page as well?
Thanks
Hey,
I’m hoping that someone can help here, as i may be missing something simple.
I use divi builder (a page builder) on my wordpress site to help customise the layout of my pages.
So far I have successfully customised the archives, ask, user, categories and tags pages by using the divi builder then dropping in the anspress shortcode.
However I cannot seem to figure out a way to use divi builder on single question pages (ie the one you’ll be reading this question on).
I have tried to change the question slug for a single question page, then create a page with the same name and edit that, but it still wont display any divi builder layout.
What am I doing wrong?
Help would be greatly appreciated.
Cheers.
Hi,
Is it possible to make customized permalinks? What I would ideally like the permalinks to be would be to include the categories and then question name as the permalink.
For example, oursite.com/category1/this-is-a-question
oursite.com/category2/this-is-a-question etc etc
Is this possible?
Thanks!
When logged in, I have notifications that are appearing (screenshot below)
When I click the link, the following appears (screenshot below)
Anyone know how to correct this problem?
Dear Support/Rahul,
Please note that profile edits still persists.
Whatever we type under description does not appear under about us.
You may also want to check the search widget, it spreads beyond its borders.
Thanks
Olufemi