Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Montezuma Theme (http://forum.bytesforall.com/forumdisplay.php?f=53)
-   -   [SOLVED] setting a virtual template for the front page (http://forum.bytesforall.com/showthread.php?t=20526)

emanuel1969 Jun 19, 2013 04:23 PM

[SOLVED] setting a virtual template for the front page
 
Hi everyone,

So I am creating my first website in Montezuma, and I can't figure out how to get my front page to use a different template. My front page is a static page named "home".

So I made a main template called "slider.php" that I want to apply to the front page, but when I assign the page "home" to the slider.php template, it does not work.

I also tried changing the main template "index.php" and assigning the "home" page to it. But that didn't work.

Can someone help?

Thanks!
Emanuel

emanuel1969 Jun 19, 2013 04:40 PM

Ok I have learned more. The virtual main template is actually working fine. It's a sub template that is not embedding into the virtual template. I made a sub template called "header2.php" and the following code in the virtual main template is not working:

<?php get_header2(); ?>

What am I not understanding here? How do I embed a newly-created sub template into a new main template?

emanuel1969 Jun 19, 2013 04:48 PM

So continuing... I got rid of the header2.php sub template and just put the code directly into my slider.php main template. That seems to work, but ONLY for page-type pages. When I assign it to my statically-defined front page (called "home") it does not work.

So it seems there is a problem trying to assign the front page to a virtual template. Or at least I'm still not getting it.

emanuel1969 Jun 19, 2013 05:06 PM

Ok I found in the instructions that you are supposed to be able to add a new header sub template to a main template by using this php code:

<?php get_header( '2' ); ?>

But it didn't work. I named the sub-template header-2.php like I was supposed to, and I called it up in my new main template (slider.php) using the php code above. Then I assigned slider.php to my front page ("home") with no luck. Then I tried assigned slider.php to a regular page on the site and it also did not work.

Sooooo.....

I am still stuck trying to figure out two things:

1. How to get a new main template to appear on a static front page.
2. How to embed a sub template into a new virtual main template.

Thanks!

jerryc Jun 19, 2013 05:16 PM

See this post.

emanuel1969 Jun 19, 2013 05:34 PM

Thanks jerryc.

That answers my second question, but I still cannot assign a new template to my front page (a static page) no matter what I try.

emanuel1969 Jun 19, 2013 05:43 PM

Just to clarify, when I edit index.php, single.php and page.php, everything works as it should and the changes display correctly on their respective pages.

But none of those templates seem to work for the "front" page when it's assigned as a static page. And furthermore, when I create a new main template (say, slider.php) and assign it to that static page, it STILL does not display.

What template is the front page using? Where do I edit it? Or how do I assign a new template to my static, front page?

Thanks anyone!

jerryc Jun 19, 2013 09:34 PM

Quote:

Originally Posted by emanuel1969 (Post 101683)
Thanks jerryc.

That answers my second question, but I still cannot assign a new template to my front page (a static page) no matter what I try.

Try naming that template front-page.php. That's what Juggledad told me, and it's worked flawlessly ever since.

emanuel1969 Jun 19, 2013 10:04 PM

OMG that was too simple. How come that is not explained anywhere? Or is it.

Thanks jerryc


All times are GMT -6. The time now is 05:38 PM.

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