[SOLVED] Custom sub templates not working
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"> Code:
<?php bfa_get_template_part( 'widgetsinfooter' ); ?> |
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(); ?> 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. |
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. |
Quote:
Quote:
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. |
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. |
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' ); ?> HTML Code:
<?php bfa_get_template_part( 'widgetsinfooter', '' ); ?> |
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. |
1 Attachment(s)
oops, I definately need another cup of coffee :p
here it is make sure you add the other patches also |
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. |
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. |
Thanks for the help, will try it later. As my primary issue is solved, marking this thread as solved.
Thanks again and regards. |
All times are GMT -6. The time now is 07:19 PM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.