Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+3 votes
393 views
in Plugins by
closed by

I'm trying to add a new section to my site. It's a collection of How-to pages (with how-to structured data scheme). So I created a new database table.

writeid title slug document
1 How to hang yourself with an electric cord how-to-hang-yourself-with-an-electric-cord <p>Step 1: Go to a local shop to buy....</p>
2 How to get 1 million Youtube subscribers in a week how-to-get-1-million-youtube-subscribers-in-a-week <p>Step 1:... </p>
3 How to eat snails how-to-eat-snails <p>Just kidding...</p>

I was able to create a writing module for this. But how can I display them.

Ex: https://www.mysite.com/instructions/how-to-eat-snails will display the content that can be pulled from such a database table above.

I have some clues using q2a functions.

$slug = qa_request_part(1);

Then check if it matches something in the database.

$qa_content = qa_content_prepare(true);

$page = qa_db_read_one_value(......); //or maybe some different functions, will check later

$qa_content['title'] = $page['title'];
$qa_content['custom'] = $page['document'];

But where do I put those codes? In index.php file in /instructions/ folder or somewhere in the Q2A system?

closed with the note: No reason
by
is /instructions/ folder contain Q2A script ?
by
No, I'm just asking how. Didn't even create that folder. Only the data table.
...