adding physical templates
Howdy
I would like to create, with full php power, a template to use for my homepage. This is so I can use some 'do_shortcode' calls required by other plugins. What am I missing - there is no spot on my page editor to choose a non-virtual theme. I have uploaded my theme into the main montezuma theme folder. I even tried naming it 'front-page.php', but this would not render any headers. I would also just like to know how to use my own templates. Thank you. -j |
I am not clear on how you installed Montezuma. You should just install like any other theme. Then within the theme options you create the virtual templates.
|
If you want to create page templates outside the theme options, copy index.php as your base. It will not be editable via the theme options, but you can use dashboard->appearances->editor to edit it.
|
Thanks for the replies...
Quote:
Quote:
Here is a clear example... I want to create a full php template (not a virtual template) called 'mytemplate.php'. I want to apply this to a page I create called 'My Page'. I can definitely start by copying index.php - but then how do I use that template for 'My page'? Part of Montezuma's ad says 'The ability to create physical page templates is preserved.'... how do I still use these 'physical' page templates if there is no way to assign them via the page editor? I only see option to use virtual templates. |
Quote:
|
Thats what I thought - but I only have boxes labelled:
Publish - Page Attributes - Virtual Templates - Featured Image http://i45.tinypic.com/14mb7sw.png I have also checked 'Screen Options' but found nothing that seems to help. Thanks yall edit: also using latest version of wordpress (3.5) but experienced the same behavior on 3.4.2 |
You, of course, do have to add code to the top of your template to let WordPress know it is a template. For example
PHP Code:
|
Thank you, that did the trick.
I thought there was something like that but could not find an example in the montezuma theme. Thank you again... -j |
Of course this opens up a new myriad of issues as get_header.php doesn't really do what I want.
I'm assuming this is because the default Montezuma header has Montezuma-specifc code in it. A suggestion would be to include an example for a physical template so we could work off of that. THank yall |
That info is in the WordPress Codex.
|
edit: the info in this post only gets you halfway...
Thanks For anyone else, the issue was partly because 'get_header()' referenced the montezuma 'header.php' which only had code to reference the montezuma virtual subtemplate 'header'. I created a new file, 'header-template.php' and referenced that in my physical template with get_header('template'). Then, I copy/pasted all the data from head.php, and added on the contents of the virtual 'header.php' sub-template. Then, I copy/pasted all the lines AFTER the get_header call in the contents of the 'index.php' VIRTUAL template, into my new physical template. Adding a basic loop in there, and we are good to go. Thanks for your help again. -j |
Bump - this is not working out as easily as it looked.
There is still 'some' missing data from my template which I'm not sure how to get at. For example, some of my plugins became disabled, and the wordpress menu (when you are logged in) that normally overlays the page at the top is gone as well. Any ideas how to get a generic 'physical' template working? thank yall -j |
OK - think I got it.
Here are the files I used to create a new generic physical template that works with montezuma: header-template.php: Code:
<?php get_template_part( 'head' ); ?> Code:
<?php Code:
</body> |
Thanks for posting this, Jeffe :)
I've been struggling with 'custom' physical templates too, and using your code I think I'm now moving in the right direction. For anyone else who comes looking: I got a slight 'lining up' problem with the physical header not quite matching my 'virtual' ones. Seem to have solved this by copying and repasting the text from the virtual template file 'header.php'. [Jeffe's example doesn't include the 'breadcrumbs' div] I also couldn't get it to display comment and footer templates ... but seem to have resolved this by using get_footer() instead of get_footer('template') in new-template.php Have to agree with Jeffe ... life would have been far simpler if there was a 'sample' physical template to re-engineer from! But it's such a great looking - and generally working - theme that I really hope I crack any problems instead of giving up! ;) If you want to see how it's going - in case I've worked out how to do something you're trying to - check out http://www.other.s-t-u-f-f.net and http://www.play.s-t-u-f-f.net ... the former is a 'real' site (which I'm developing first using Wampserver offline) and the latter is a 'test' site to check things work on my real server as they did on the Wampserver! |
Quote:
|
Tried that ... most copied templates seem to be coming up 'blank' for some reason ... and I'm fairly sure that when I have copied the contents of a 'virtual' template to ".../wp-content/themes/montezuma" although the re-engineered page / post etc. is there, there's no styling / header / footer etc. Jeffe's way may not be the 'right' way ... but it's working ;)
|
Quote:
When you say blank, do you mean the template file in the online editor is blank or the page /post where you use the template is coming up blank? |
Quote:
I need to use 'non-standard' php and 'if' conditions in posts ... and once I've cracked that (which I seem to have!) then I need to use what I learn on 'index.php' and all of the other WP templates that are similar ... 'category.php', 'tag.php', 'search.php', etc. (Hey, maybe I'll even work out how to get two columns of excerpts. That was my original start point anyway ... led me to this theme, now it's taking days and days! :( ) |
Quote:
Also, any template can be restored to it's defaults. On the edit page, there's a reset button. Maybe you can try that with an obscure one, and see what happens. Quote:
Even though I don't know much about posts or excerpts, I do understand php arrays. I have an example of one posted here that might be helpful as a starting point. Here's the sequence of what I'm doing:
Modified to what it sounds like you're doing:
If, instead, you wanted them laid out: 1 | 2 3 | 4 5 | 6 ... or a different group of excerpts in each column, you'd just modify the code accordingly, which it sounds like you can figure out. I hope this helps. |
Quote:
Quote:
... Thanks for the link and the suggestions. It sounds a bit complicated for me ... the excerpts will be generated by the visitor, using the "Query Multiple Taxonomy" plugin and working out how to turn that into an array ... :confused: (which I'm not yet at all familiar with anyway tbh); but I only need one image for each excerpt on the site I'm currently working on, so there could be a lot of 'white' space. Now I've sussed out physical templates I think I'll be able to 'hack' the POSTS loop to get a 1-3-5 column and a 2-4-6 one. I'm leaving that till 'last' though ... I suspect I'll be saying goodbye to a large chunk of my life to get that working! |
Quote:
Quote:
|
Quote:
|
Quote:
see RFE 013-07: Add a confirm dialogue to all the 'reset' options |
FTP - issues that arise when using FTP depends on how your host is set up and the server UID of teh 'wordpress' user verses the UID of the 'FTP' user. On some hosts, they work together, on some hosts they don't. And that's as far as I'm going to go into it. to give a detailed explaination that a layperson could understand would take a couple hours to think up and write up and edit and since no one is paying me to do it...for a detailed explaination go do a bunch of research on user premissions in apache, wordpress, and ftp. ;)
|
Thanks for the 'short version' explanation, Juggledad. I guess I'm lucky in that FTP has always worked for me with pretty much no problems. I'll continue to use this method, but if it goes belly-up one day, I'll remember your wise words and switch to direct editing via the WP dashboard instead! :)
|
All times are GMT -6. The time now is 08:45 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.