How many ways are there that you can create a custom page? I am asking this because I want to dedicate some part of my website to some adventures that I’ve had with code either CSS or jQuery or Vanilla/WP PHP.
The solutions that I have already come up with are:
- Custom Post Type
- Custom Page Template
- WP Hierarchy – creating separate php files
- Default post and page
- … – I’ll fill this in the future:) –
Except option 3 all the others need some way to override default WP behavior to enable myself to enter PHP script inside the post. To overcome this obstacle several solutions have been suggested:
- Use of a plugin such as https://wordpress.org/plugins/insert-php/
- Through a shortcode
I have two problems using plugins. Firstly I tend to write my own code and usually am wary of plugins. Secondly I doubt that some requests to the database would work inside the plugins. Shortcodes are not much of great solution too and my reason for that is that it needs to be stored inside files rather than the database.
I’m gonna try the plugin first to see what happens.
Update: I downloaded and installed PHP Everywhere. So far it seems fine. I have tested get_title() and the tile of the current post was returned. Now I would like to know where in the database it keeps the data. Is it considered as a
Update: The data for PHP Everywhere is collected inside WP_postmeta which is what I hoped. This means that every snippet is in relation with one post so the data is stored neatly and cleanly.
Note to myself:
Post types, post page, attachdment …
taxonomy – category, tag, link category, post formats classification and organization
‘custom-fields’ (aka meta-data) – can be added to taxonomyies) – data about data, post_content, post_title, post_author, post_name(=slug)
page template: full-width, sidebar left