Page 1 of 1

How to add PHP into HTML?

Posted: Mon Dec 08, 2008 12:31 pm
by foody
I have just one question to ask, I have lots of php files from a theme site. These php files are called footer, functions, green, header, index, print, page, sidebar, etc all of them a php file. It just a matter of lego pieces that I need to put together. My question is, if I have a PHP called footer for example, how do I add that into my OTHER file called index.php for example (writing in .HTML)? Thanks in advance.

Re: How to add PHP into HTML?

Posted: Mon Dec 08, 2008 12:40 pm
by watson516

Code: Select all

<html>
<head>
         <title>Site Title</title>
         <style type="text/css">
         </style>
</head>
<body>
         <p>Body Contents</p>
<?php
include("footer.php");
?>
</body>
</html>
Something like that?

Re: How to add PHP into HTML?

Posted: Mon Dec 08, 2008 12:47 pm
by foody
Perfect but ones the footer or header or sidebar is being included is just a matter of adding that name for example sidebar.php on the div for side bar? That is it?

Re: How to add PHP into HTML?

Posted: Mon Dec 08, 2008 12:50 pm
by watson516
foody wrote:Perfect but ones the footer or header or sidebar is being included is just a matter of adding that name for example sidebar.php on the div for side bar? That is it?

If you have a div that is setup for the sidebar or header or whatever, then you just open the div, include the php, close the div.

Code: Select all

...
    <div class="sidebar">
         <?php include("sidebar.php"); ?>
    </div>
...

Re: How to add PHP into HTML?

Posted: Mon Dec 08, 2008 1:26 pm
by foody
Are you familiar with the WordPress theme, my intention is to simply get a theme and put it together. Do you have any idea about it? This is the first time I am using WordPress that is all. Thanks in advance.

Re: How to add PHP into HTML?

Posted: Mon Dec 08, 2008 3:34 pm
by greyhoundcode
Normally if you've downloaded a Wordpress theme it will be ready to go, and the index.php will already have been put together.

If you're building a WP theme from scratch then you should take a look at the Wordpress Codex http://codex.wordpress.org/Theme_Development and also I'd recommend this tutorial: http://www.wpdesigner.com/2007/02/19/so ... hemes-huh/ which starts with the basics and builds up from there.

There's a couple of themes already available on new Wordpress installations - you can always dive in and take a look at how they do things.

Re: How to add PHP into HTML?

Posted: Mon Dec 08, 2008 3:55 pm
by foody
I have downloaded wordpress theme actually and it does contain the index.php. Are you telling me that is it, I have the wordpress theme I wanted without me having to do anything at all?

Re: How to add PHP into HTML?

Posted: Mon Dec 08, 2008 4:14 pm
by greyhoundcode
Generally speaking that's how it goes - login to the dashboard and if the theme's ready to go then you will be able to preview and activate it.

* Also - make sure you've placed the theme directory in the right place. Can't remember the exact path off the top of my head but it is something like wp-content/themes/ - I'm sure you'll find it with a quick bit of exploration :-)

Re: How to add PHP into HTML?

Posted: Mon Dec 08, 2008 4:30 pm
by foody
Well this is how it is, there is this guy he wants me to make a theme for him that follows this website here:

http://www.kriesi.at/demos/index.php?wp ... ommunizine and it have these things on it:

The theme supports community building through the possibility of letting users submit news and displaying them with the help of a sidebar widget. Further a logged in user can create a favorite post list of entries he or she likes.

The theme comes with 4 widgets

* advertising
* front page login->logged in users see a small administrative interface
* sidebar widget for displaying community news
* widget for displaying favorite posts of a user

These widgets can be used in 4 different widget areas:

* sidebar-top
* sidebar-tabs
* sidebar-bottom
* footer

“Sidebar-tabs” automatically creates jQuery tabs out of the widgets that are applied to it, the other 3 areas display it in “normal mode”.

The theme comes with an additional administration page. here you can define which javascript improvements you want to enable.
(jQuery support, parralax scrolling header, tabs, smooth scrooling for anchor links…)
You also have the possibility to add your Google analytics code here.

Another addition: in the write post panel you can flag a post as featured now and attach a large image, this will be displayed as featured post. You dont need a specific category for featured posts any more.

Other features:

* Parallax Scrolling Header
* Breadcrumb navigation with nested page/category support
* CSS Drowpdown Menu enhanced with jQuery
* Gravatar Support
* Comments of Post Author and admin are highlighted
* Seperation of comments and trackbacks
* Header PSD included: the text is made out of layer styles and fully editable so you can easly change the name of the site. You can also easily change the background image and add your own scrolling scenario ;)
* Valid HTML/CSS works in every major browser (Firefox 2+3, IE6, 7, 8 Beta1, Chrome, Safari, Opera)

and he told me this precisely "daya: fahed, look what i need is a wordpress theme as you get any wordpress theme when you download from here http://wordpress.org/extend/themes/
with the clear installation and activation instruction.
that is it."

So, do I get it from what he is saying that he wants me to pick a theme that is already set and can be downloaded but have the same style theme as the link I send you with the menu and search and etc? I am only asking because this is the first time I am doing something like this and need to understand what he wants exactly? Thanks.