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.
||How to hang yourself with an electric cord
||<p>Step 1: Go to a local shop to buy....</p>|
||How to get 1 million Youtube subscribers in a week
||<p>Step 1:... </p>|
||How to eat snails
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?