Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Montezuma Theme »

Using Custom template and sub-template


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Oct 13, 2012, 08:50 AM
rick9004
 
3 posts · Oct 2010
I have a copy of the PAGE template that is my main custom page template. I created two sub templates to house my header and footer. In the page I select my virtual template. Then in the custom template I add these statements:

<?php bfa_get_template_part('newheader'); ?>

<?php bfa_get_template_part('newfooter'); ?>

They do not display either header or footer. The main custom template however is working, I know that it is being displayed.

I have tried all sort of variations and checking the spelling of the name. I look at the code for this function and off hand do not see anything wrong.

Either I've got the function call wrong or there is something else that need to be set to get sub-templates to display
  #2  
Old Oct 13, 2012, 06:27 PM
jerryc
 
367 posts · Oct 2012
Florida
Try this concept:

PHP Code:
<?php get_header'whatever' ); ?>
Quote:
Includes header.php sub template.
In case you created a second 'header' sub template in addition to the standard header.php, such as header-2.php, you could include it with <?php get_header( '2' ); ?>. Whatever you put into the brackets will be appended to header with a dash - in between, and that file will be included: E.g. to include header-whatever.php in a main template you would use <?php get_header( 'whatever' ); ?>
PHP Code:
<?php get_footer'whatever' ); ?>
Quote:
Includes footer.php sub template.
Same as get_header but for the 'footer' sub template
You can also use
PHP Code:
<?php dynamic_sidebar'whatever' ); ?
anywhere, including in headers and footers.
  #3  
Old Oct 13, 2012, 10:48 PM
jerryc
 
367 posts · Oct 2012
Florida
Quote:
Originally Posted by jerryc
Try this concept:

PHP Code:
<?php get_header'whatever' ); ?>
You can also use
PHP Code:
<?php dynamic_sidebar'whatever' ); ?
anywhere, including in headers and footers.
I need to change my headers, too. I just tried the get_header, just like the documentation says, and it didn't work for me. I tried the dynamic_sidebar instead of a header, and it worked in the header, but the styling was terrible.
  #4  
Old Oct 14, 2012, 11:53 AM
juggledad's Avatar
juggledad
 
22,263 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
There is a problem with subtemplates. if you notice they don't get a '.php' extension' This part of the code is being rewritten be the developer for the next release so don't put too much time into it for now.

[Update - 1/30/31] the fact that the extension is not there does't matter, the template will still be used. the issue is just the on screen display
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Jan 30, 2013 at 12:06 PM.
  #5  
Old Oct 14, 2012, 08:11 PM
jerryc
 
367 posts · Oct 2012
Florida
It's great to have your guidance on these things juggledad.

Thanks.

Any eta on the new release?
  #6  
Old Jan 30, 2013, 10:53 AM
jerryc
 
367 posts · Oct 2012
Florida
Juggledad,

A while back, I posted:.

Quote:
Originally Posted by jerryc
I need to change my headers. I just tried the get_header, just like the documentation says, and it didn't work for me.
You replied:

Quote:
Originally Posted by juggledad
There is a problem with subtemplates. if you notice they don't get a '.php' extension' This part of the code is being rewritten.
So, I've been making do with one header and one footer for now while working on other stuff in the meantime.

Recently, you posted:

Quote:
Originally Posted by juggledad
to make a copy of the header (or footer) virtual template do the following
1) go to mto->Sub Templates->+ Add sub template
2) in the 'Template name' field add a name like 'header-custom'. and press the 'ADD Sub Template button.
3) go to mto->Sub Templates->header.php (or footer.php) do a select all and copy
4) go to mto->Sub Templates->header-custom and paste teh code and press 'SAVE Changes'

now where ever you are calling the header (or footer) use the new templage name like
HTML Code:
<?php get_header('header-custom'); ?>
So, I tried it again, this time, using your suggestion of:

HTML Code:
<?php get_header('header-custom'); ?>
instead of how the documentation reads:

HTML Code:
<?php get_header('custom'); ?>
Neither way worked for me. I tried it at the top of my template, and it still gave me the default header. Just for kicks, I copied and pasted the identical code at the bottom of my template, and it gave me nothing at all.

How did you get it to work? What am I missing?

Thanks,

Jerry

P.S. Making a new subtemplate by selecting the option to copy an existing on produced an empty subtemplate for me. Your suggestion of copying and pasting did work to make the file, it just didn't display anything.
  #7  
Old Jan 30, 2013, 12:06 PM
juggledad's Avatar
juggledad
 
22,263 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
export your settings and attach them to a reply
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #8  
Old Jan 30, 2013, 12:16 PM
jerryc
 
367 posts · Oct 2012
Florida
I'm glad that you can read these tea leaves.

P.S. I'm almost out of attachment space. How do I get more, or should I delete things?

Last edited by jerryc; Jan 30, 2013 at 02:02 PM.
  #9  
Old Jan 30, 2013, 12:38 PM
juggledad's Avatar
juggledad
 
22,263 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
Quote:
I'm almost out of attachment space. How do I get more, or should I delete things?
you need to delete things
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #10  
Old Jan 30, 2013, 12:43 PM
juggledad's Avatar
juggledad
 
22,263 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
I don't see a custom-header' in the virtual subtemplates or a reference to it in any of your main virtual templates.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #11  
Old Jan 30, 2013, 01:30 PM
jerryc
 
367 posts · Oct 2012
Florida
Quote:
Originally Posted by juggledad
I don't see a custom-header' in the virtual subtemplates or a reference to it in any of your main virtual templates.
Yes, I deleted them after I couldn't get them to work.
  #12  
Old Jan 30, 2013, 01:50 PM
juggledad's Avatar
juggledad
 
22,263 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
Then why did you post on this thread and send your settings?
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #13  
Old Jan 30, 2013, 01:59 PM
jerryc
 
367 posts · Oct 2012
Florida
Quote:
Originally Posted by juggledad
Then why did you post on this thread
Is there something about the post that you don't understand?

Quote:
and send your settings?
You asked for them. I don't know what they are, or even how to read them. I suspect that the problem isn't about my settings, anyway.
  #14  
Old Jan 30, 2013, 06:08 PM
juggledad's Avatar
juggledad
 
22,263 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
I was incorrect in assuming since you said you tried it again and it didn't work and were asking for help you still had the virtual templates in your site. I asked to see the export because it would contain your templates and I could look to see if there were any errors.

Since you deleted them, you don't have a problem that I can look at and there was no need to spend any time on this. I will close this thread.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert Atahualpa 3 columns template into 2 colums template? phboujon Page & Category Menu Bars 3 Jun 7, 2010 04:05 AM
Adding shortcode in custom template paulae Plugins & Atahualpa 1 May 21, 2009 04:20 PM


All times are GMT -6. The time now is 11:59 PM.


Powered by vBulletin® Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.