• Hi
    This may sound like a daft question but I need to have just an image and some text for my home page on my WordPress site.

    I don’t need a header, sidebar, footer for the home page just an image and some text. That text will link to the main wordpress site where I will be using standard wordpress pages etc.

    Can this be done by editing the index.php?
    I tried this

    <div id="photo">
    
    		<img src="HannahGREEN.jpg" />
    
    	</div>

    using the following in the stylesheet

    #photo {
    	position:absolute;
    	top:100px;
    	left:150px;
    }

    but it does not work.

    Am I being stupid?
    Cheers
    Mat

Viewing 3 replies - 1 through 3 (of 3 total)
  • Are you using WP 3.0 or higher?
    If so you can create a new template called front-page.php which will be used for your home page.

    If not then you need to create a home page template, but really, you should just upgrade.

    Even if you have a specific front-page or home page template, though, you still need a header and a footer.

    The header contains the doctype, meta, style sheet, etc… while the footer has the closing body and html…..

    well, first off, where are you storing that photo?

    to link to an image in wp, normally you would put that image in the images folder in your theme, and link like this:

    <img src="<?php blog_info('template_url'); ?>/images/HannahGREEN.jpg" />

    but, you shouldn’t just overwrite the index.php, leave it alone. It’s important for displaying any blog posts….even if they are not on your front page

    Make a new php file called whatever you want…. say whatever.php

    Then put this at the top to make it a template:

    <?php
    /*
    Template Name: Whatever
    */
    ?>

    Then you can put in your custom code. You do need to call <?php get_header(); ?> at least, you need the header to bring in important WP stuff. If you don’t want to include your normal header, you need to include a lot of the stuff in your header file somehow. the stuff in between the <head> and </head> tags

    After you make your page template, you make a normal WP page through the page maker, and on the right side assign the template you just created to the page (Whatever in our example)

    You don’t need to include any content in the page, just setting it up and assigning the template brings in your custom code.

    And finally, in settings->reading, you can assign this new page as your front page.

    Thread Starter funkton

    (@funkton)

    Excellent!
    Thanks!
    I did the following

    <?php
    /*
    Template Name: Whatever
    */
    ?>
    
    <html>
    <head>
    <title>Demo Template</title>
    
    <link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>">
    
    </head>
    
    <body>
    
    <div id="wrapper">
    
    	<div id="photo">
    
    		<img src="HannahDeCanchoGREEN.jpg" alt="Klematis" width="300" height="446" />
    
    	</div>
    </div>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Basic Home Page’ is closed to new replies.