There is almost bare WordPress 3.9.
It is required to make a page with a set of input'ov and save the data in the database.
On another page you need to display this table. Inside the table there will be buttons, for example, to raise the line up, etc.
Tell me, please, an easy way to do this, only the general scheme, of course, maybe, there are useful plugins for this? How are such questions solved in wordpress?
Thank.
- onepods cms inside is better not to even look - etki
- if you need a specific page, then take a page template, for example, page-your_id.php, and edit it there. Requests can be done through the $ wpdb object, nothing complicated there. Better a few lines of code than installing a plugin, etc. - Vfvtnjd
- @dmitmedv, If you are given an exhaustive answer, mark it as correct (click on the check mark next to the selected answer). - Vitalina
1 answer
It's simple. Create a new file in the folder with the Wordpress theme, for example, my-custom-page.php . At the very beginning of this file we add the following code:
<?php /* Template Name: Страница Инпутов */ ?> <?php echo 'Hello'; ?> After that we create a new page in the admin panel, on the right in the template section we select the Page template -> Inputs page . Now, Hello will be displayed at the address of the page we created. In this file we can write the code of interest to us. For more information about page templates in the official documentation .
Now a little about working with the database. You can use the standard class for working with the wpdb database. Documentation in Russian regarding this class is here . The main thing to remember is to screen the data being written, or to use placeholders.
An example of an my_custom_table into an arbitrary table my_custom_table .
$wpdb->query($wpdb->prepare("INSERT INTO my_custom_table ( param1, param2, param3 ) VALUES ( %s, %s, %s )",array($param1,$param2,$param3)));