Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

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

Using Custom template and sub-template


  #1  
Old Oct 13, 2012, 08:50 AM
rick9004
 
3 posts · Oct 2010
Using Custom template and sub-template

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
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
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.

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:08 PM.


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