No Loops here.
Imagine you want to replicate the behavior of page.php in the template 'T'. Usually in the single.php and page.php you can use all the template tags like "the_title, the_content, the_ID" etc. which return their results in relation to the current page/post displayed.
Currently in a custom page template you can use only "the_title" to get the title of the page which the template is attached to. But not the other tags (of course you can use all the tags in a Loop, but it is not what I want to do).
If the behavior I am trying to explain here would be available, you could use the fields of a page to store some stuff that you can then use in the template attached to that page.
Concrete example: I am building a website for a company. In this website there is a page "Partners".
The structure of that page has to be:
- Title
- Some text to explain the page content
- A list of partners
This is what I did:
- I created a link category "Partners"
- I added partners' information as "Links" (Blogroll) under the above category
- Created a wordpress page "Partners"
- Created a wordpress custom page template "Partners template"
- In the template I use 'get_bookmars()' to get the partners' information
- In the template I use "the_title()" to get the title of the page which the template is attached (that is, "Partners" in this case)
If you look at the structure explained above, the problem is that at this point I can retrieve the title and the list of partners from the DB, but not the "some text".
I stored that text in the "content" of the "Partners" page, but I cannot retrieve it in the same straightforward way I retrieved the title, i.e. the_content() returns nothing.
What I was wondering is "why allow the_title and not the other tags?" It would be very useful. At least to me. But I think that other people should find this very useful.