WordPress.org

Ready to get started?Download WordPress

Forums

Custom Page Template Won't Display Any Content (8 posts)

  1. Aedryan Methyus
    Member
    Posted 2 years ago #

    I have been researching and weighing out options relentlessly for the best way to go about converting my existing HTML site over to WordPress, while leaving my existing site undisturbed as i'm developing my new site within WordPress, etc... The most feasible/least problematic way I can come up with would be to go ahead and install WordPress in my root and create a static front page, which duplicates my present index.html page exactly. That way I could be developing my new WordPress site in the background and easily make the transition when it's ready to go live.

    Sooo... What i'm currently trying to do is create a completely blank, full width page template, with no WordPress menus/posts/header/footer/etc. The page must be an exact duplicate of my existing index.html page with nothing more than my current content/graphics/links/etc. I have been following the directions on the following page for creating my custom template:

    http://codex.wordpress.org/Pages#Creating_Your_Own_Page_Templates

    and I will be using the directions on the following page for using the page I create as a static front page:

    http://codex.wordpress.org/Creating_a_Static_Front_Page

    Right now, the problem i'm having is, I can't get ANY content (no text, images... nothing) to display when I try to create a page using the custom page template I created. This is the only code I have in my page template at the moment:

    <?php
    /*
    Template Name: Front Page Test
    */
    ?>

    Can someone please tell me what I have to do to get my content to display?

    Thanks in advance for any help and suggestions you guys may have.

    ~ Aedryan

    PS Just FYI i'm running WordPress in a sub-directory at the moment just for testing. I really don't want to develop my new site in there and be faced with all of the potential complications of moving it to my root or running it from a sub-directory, etc...

  2. govpatel
    Member
    Posted 2 years ago #

    All you need to add html code after ?> and save the file as .php and upload on your theme folder and then when you create page you will see Front Page Test template in page attribute

  3. johnfakorede
    Member
    Posted 2 years ago #

    What govpatel said.

    Also, a quicker and more fool-proof way to setup your home page template is to name it home.php. WordPress will pick it up automatically without you needing to link the template via page attributes. In this case you won't need the /* Template Name: ... */ block.

    If you've switched your front page to a static page, also add something like this to your functions.php:

    function site_templates($template) {
    	// Use home.php for front page
    	if ( is_front_page() )
    		$template = get_query_template('home');
    
    	// Use blog.php for blog section homepage
    	if ( is_home() && get_post_type() == 'post' )
    		$template = get_query_template('blog');
    
    	return $template;
    }
    add_filter('template_include', 'site_templates');
  4. govpatel
    Member
    Posted 2 years ago #

    Sooo... What i'm currently trying to do is create a completely blank, full width page template, with no WordPress menus/posts/header/footer/etc. The page must be an exact duplicate of my existing index.html page with nothing more than my current content/graphics/links/etc. I have been following the directions on the following page for creating my custom template:

    The reason I said that he wants the same index.html page and one thing to remember is that this content will not be saved on database you will just creating blank page with the template.

  5. Aedryan Methyus
    Member
    Posted 2 years ago #

    Thanks a lot you guys! I really appreciate all of your help!

    Govpatel... I didn't realize I had to add all of the HRML/content directly in the file before I uploaded it. I had been trying to add content to the page from within WordPress admin. So... Since the content won't be saved in the database, will my index.php page still be automatically added to my sitemaps or not? Any technical drawbacks to the page not being stored in the database?

    John... I'm still trying to absorb your suggestions, but i'm thinking that might be the way to go once my WordPress site is ready to go live. What are the pros and cons of doing it this way versus the way i'm doing it now?

    Thanks again. You guys are awesome!

    ~ Aedryan

  6. Aedryan Methyus
    Member
    Posted 2 years ago #

    Sorry for all of the questions you guys, but I have yet another one. I'm pretty sure I have the whole static/splash front page thing figured out. However, I do still want my blog's "homepage" (the default index.php page) to open when users click on a link to enter the blog section of my website as well. How would I go about doing that?

    ~ Aedryan

    [ Please do not bump, it's not permitted here. ]

  7. Aedryan Methyus
    Member
    Posted 2 years ago #

    Just as an update, I went ahead and moved forward with installing WordPress in my root directory. I have my static front page all up and running with my existing site running, as I silently develop my WordPress site and convert my old pages in the background... Mission accomplished! >8>) The blog "homepage" question I had in my last post worked itself out as well. For some reason, when I assigned a blog page it automatically pulls up my template's default homepage, exactly as I wanted.

    I really would like to be clear on a couple of things regarding the static front page thing, though... Firstly, since the static front page and it's content will not be stored in the database, it's not going to cause any problems as far as my sitemaps and search engine spiders crawling my site, is it?

    Thanks again for all of your help and suggestions, guys. It has been very much appreciated!

    ~ Aedryan

  8. Aedryan Methyus
    Member
    Posted 2 years ago #

    *sigh* Well... Here is the newest issue... My theme's blog page has a large slider at the top and a Quote Line 1 and Quote Line 2, which are supposed to reside beneath the slider. For some reason the slider is shifted down and it's over top of the quote lines. Everything is setup identical to the way it is on my test installation, except for I now have a static front page assigned and the blog page is assigned as the posts page in settings/Reading Settings. That's the only difference. I have tried deactivating every plugin one at a time to make sure there aren't any conflicts with no success.

    Can someone PLEASE help me out with this?

    ~ Aedryan

Topic Closed

This topic has been closed to new replies.

About this Topic