Answer the question
In order to leave comments, you need to log in
What is the best way to make a website on wordpress with php code placed on each page?
We need a website-personal account with various registration forms, tables, graphs. Almost every page includes php code.
What is the best way to do it in the first place? A couple of options came to mind:
1. Put code in the theme that analyzes the url and loads content depending on the part of the page url
$url_arr = explode( '/', $url );
$page = $url_arr [3]; // https://qna.habr.com/<b>question</b>/new
$action = isset($url_arr [4]) ? $url_arr [4] : ''; // https://qna.habr.com/question/<b>new</b>
switch ($page) {
case 'reg':
require $dir . 'reg.php';
break;
case 'report':
require $dir . 'report.php';
break;
case 'prefile':
require $dir . 'prefile.php';
break;
...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question