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 »

[SOLVED] Custom sub templates not working


  #1  
Old Mar 20, 2013, 05:33 AM
asifnkhan's Avatar
asifnkhan
 
6 posts · Mar 2013
India
Send a message via Skype™ to asifnkhan
I have created a sub-template to show three widgets below the main row and above footer. The problem is that when I call those templates from any main template they just don't work. To me, the code is right as if I insert same code directly into footer.php, it works. But, I can't use it because I just want to show those widgets on single posts/pages not the homepage. Check the code below:

Code:
<div id="footerwidget-bg">
<div id="main" class="row">
  
<div id="footerwidget-one" class="col4">
	<?php dynamic_sidebar( 'Footer Widget ONE' ); ?>
</div>

<div id="footerwidget-two" class="col4">		
      	<?php dynamic_sidebar( 'Footer Widget TWO' ); ?>
</div>
  	
<div id="footerwidget-three" class="col4">
	<?php dynamic_sidebar( 'Footer Widget THREE' ); ?>
</div>	

</div>
</div>
I am using below code to call the widgetsinfooter.php sub template.

Code:
<?php bfa_get_template_part( 'widgetsinfooter' ); ?>
  #2  
Old Mar 20, 2013, 05:54 AM
jerryc
 
367 posts · Oct 2012
Florida
For the templates where you want to use it, such as single.php and page.php, if you insert all that code above:

HTML Code:
<?php get_footer(); ?>
it should do what you want.

Another possibility would be to make a separate footer and put that code into the top of a special footer, but I and others have had some difficulty making other footers work. I think there's a patch for that, but I haven't used it.
  #3  
Old Mar 20, 2013, 06:15 AM
asifnkhan's Avatar
asifnkhan
 
6 posts · Mar 2013
India
Send a message via Skype™ to asifnkhan
Yeah, inserting the whole code directly works but that makes the template a bit more complex. I wanted to use the sub templates to make it compact and quick in editing.

And to make a special footer I'll have to create another sub-template which also won't work, custom sub-templates are just not working for me.

Can you please link to the patch you are talking about?

Thanks for the response.
  #4  
Old Mar 20, 2013, 06:26 AM
jerryc
 
367 posts · Oct 2012
Florida
Quote:
Originally Posted by asifnkhan
Yeah, inserting the whole code directly works but that makes the template a bit more complex. I wanted to use the sub templates to make it compact and quick in editing.

And to make a special footer I'll have to create another sub-template which also won't work, custom sub-templates are just not working for me.
Bear in mind, this is only the first release of MZ, and it's by a developer who's already well known for creating another great theme. If you can make it work now with some workarounds, I expect a lot of the problems will be gone with the next release.

Quote:
Can you please link to the patch you are talking about?
I think it's this one. All the patches are in stickies at the top of the MZ forum.

This one might make your approach work, too. I haven't tried any of them. I've been able do to all I need with workarounds.

Last edited by jerryc; Mar 20, 2013 at 06:29 AM. Reason: Alternative patch
  #5  
Old Mar 20, 2013, 06:44 AM
asifnkhan's Avatar
asifnkhan
 
6 posts · Mar 2013
India
Send a message via Skype™ to asifnkhan
OK, I'll have to put the code directly in templates to make it work. And, for the developer, he has already put some amazing work in this theme, I am not asking for more but improvements are always welcome.

Thanks for you replies. I'll see if I can make it work with sub templates.
  #6  
Old Mar 20, 2013, 08:24 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
please try the following
1) unzip the attached file
2) move the two files to the 'montezuma/includes' folder
3) change your
HTML Code:
<?php bfa_get_template_part( 'widgetsinfooter' ); ?>
to
HTML Code:
<?php bfa_get_template_part( 'widgetsinfooter', '' ); ?>
and see it that works for you.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #7  
Old Mar 20, 2013, 08:37 AM
asifnkhan's Avatar
asifnkhan
 
6 posts · Mar 2013
India
Send a message via Skype™ to asifnkhan
Thank you Sir for your response. Unfortunately, I can't find any attached file, may be it's just me.

Also, is there any way to add a condition to the widget areas? For instance, If there is nothing in the widget area then it just won't render on the site and if it has something then it will show on the site. Right now, empty or not, it just reserves the space on the site for the widget.
  #8  
Old Mar 20, 2013, 08:39 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
oops, I definately need another cup of coffee
here it is
make sure you add the other patches also
Attached Files
File Type: zip testfix.zip (9.7 KB, 973 views)
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #9  
Old Mar 20, 2013, 08:53 AM
asifnkhan's Avatar
asifnkhan
 
6 posts · Mar 2013
India
Send a message via Skype™ to asifnkhan
Woohoo, that worked. Thanks a lot Sir for this.

Only one more thing (for now), is there any way to add a condition to the widget areas? For instance, If there is nothing in the widget area then it just won't render on the site and if it has something then it will show on the site. Right now, empty or not, it just reserves the space on the site for the widget.
  #10  
Old Mar 20, 2013, 09:29 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You don't need to do anything EXCEPT change the ID you are using

ID's must be unique on a page, you now have two ID's called 'main' and there is some CSS applied to that ID.

Change your ID to 'mymain' and watch what happens.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #11  
Old Mar 20, 2013, 09:43 AM
asifnkhan's Avatar
asifnkhan
 
6 posts · Mar 2013
India
Send a message via Skype™ to asifnkhan
Thanks for the help, will try it later. As my primary issue is solved, marking this thread as solved.

Thanks again and regards.

Bookmarks

Tags
adding new widget areas, footer widgets, montezuma, styling new widgets, sub templates



Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom templates and sticky posts Mesjps Atahualpa 3 Wordpress theme 0 Jun 1, 2012 02:27 AM
Custom Post Templates Revisited waded1 Atahualpa 3 Wordpress theme 12 Apr 7, 2012 11:15 AM
Auto-install borked custom templates - but I should have known better... rickheck New Versions, & Updating 3 Dec 15, 2011 03:37 PM


All times are GMT -6. The time now is 12:12 AM.


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