Need guidance with templates vs pages
-
I’m struggling with a concept and can’t seem to get my head around it. I’ve searched and read many articles, and also tried experimenting, but I can’t get it clear in my head (and can’t get it to work).
What I’m trying to do – My theme has a ‘front page’ that is nothing but an image with a link; I want that link to take me to an index of all (or most) posts. My theme has a template for ‘index’ and that looks perfect – but how do I link to this ‘index’? Since the index is a template, not a page, do I need to first create a page based on that template (or referencing that template)? Or can I link directly to the index template – and if so, what’s the syntax for that? (I tried #index and /index, to no avail).
Basically, I understand that templates are a means of applying a consistent behavior/look to all pages/posts/etc on the site. But is a template simply a ‘starting point’ for a page, or is a template a ‘framework’ that ‘constrains’ a page? Can templates be used in place of a page, or must they be applied to a page in order to be used?
I had assumed I could create a new page, then ‘apply’ a template to it (assuming the template is a framework for the page). Some guides describe exactly that, but they may be dated (not written for the Gutenberg / block editor perhaps?). When I create a new page, over on the right, I see ‘Template’, with subs for ‘Edit Template’ / ‘create new template’ / ‘show template’. I was expecting a list of possible templates to apply to my page. At the bottom, under ‘Page Attributes’, I see nothing related to templates.
I’m going crazy trying to get this basic concept straight in my head – my apologies!
The blog I need help with is: (visible only to logged in users)
-
I achieved the end result I wanted – a link from the front page to an ‘index-like’ page – but I don’t understand why it worked or, really, what I did – I just tried something that worked. Here’s what I did:
- I created a new page (‘add new page’), and was presented with a screen asking me to pick a predefined ‘layout’.
- One of the layouts presented was ‘Blog Posts’. It looked like what I wanted, so I chose that predefined layout.
- I then edited my front page link and linked to /BlogPosts. This worked!
But my questions are –
- the ‘template’ of this ‘Blog Posts’ page is shown as ‘Pages’ on the right hand side – NOT ‘Index’, which is what I expected it would be. So what is the purpose of the ‘index’ template? It visually looks very much like the ‘Blog Posts’ layout I chose.
- Can I make this an unlimited page … that is, not constrained to 10 entries? I think I read that there’s a limit of 10 somewhere, by default. Can I make it multi-page, as in, requiring a ‘next’ action to go to the next 10 items?
- The topic ‘Need guidance with templates vs pages’ is closed to new replies.