A ver... si me se explicar:
php y html son cosas que apesar de convivir en tiempo de programación no estan nunca juntas en tiempo de produción.
PHP es un lenguaje que se ejecuta en el servidor, el cual acaba generando un fichero HTML que el servidor transmite al cliente y este interpreta.
La sintaxis de un fichero .php permite generar html basicamente de dos formas
1. mediante el comando "
echo" entre las etiquetas <?php y ?>
2. directamente fuera de las etiquetas <?php y ?>
Código PHP:
Ver original<?php
global $k_option, $custom_widget_area;
if ($k_option['custom']['bodyclass'] == "") // check if its a full width page, if full width dont show the sidebar content
{
################################################## ############################
# Display the sidebar menu
################################################## ############################
foreach($k_option['custom']['sidebars'] as $sidebar)
{
$default_sidebar = true;
$sidebarSize = "";
if($k_option['includes']['sidebarCount'] != 2) $sidebarSize = ' fullwidth_sidebar';
echo "<div class='sidebar ".$sidebarSize."'>";
//Frontpage sidebars:
if (function_exists('dynamic_sidebar') && is_home
() && dynamic_sidebar
('Frontpage Sidebar '.$sidebar) ) : $default_sidebar = false; endif;
//unique Page sidebars:
if (function_exists('dynamic_sidebar') && dynamic_sidebar
('Page: '.$custom_widget_area.' '.$sidebar) ) : $default_sidebar = false; endif;
//unique Category sidebars
if (function_exists('dynamic_sidebar') && dynamic_sidebar
('Category: '.$custom_widget_area.' '.$sidebar) ) : $default_sidebar = false; endif;
// general pages sidebars
if (function_exists('dynamic_sidebar') && is_page
() && dynamic_sidebar
('Sidebar Pages '.$sidebar) ) : $default_sidebar = false; endif;
// general blog sidebars
if (function_exists('dynamic_sidebar') && (is_category
() || is_archive
() || is_single
() ) && dynamic_sidebar
('Sidebar Blog '.$sidebar) ) : $default_sidebar = false; endif;
//sidebar area displayed everywhere
if (function_exists('dynamic_sidebar') && dynamic_sidebar
('Displayed Everywhere '.$sidebar)) : $default_sidebar = false; endif;
//default dummy sidebar
if ($default_sidebar && $k_option['includes']['dummy_sidebars'] == 1)
{
//left dummy sidebar
if($sidebar == 'left'){
$exclude = '';
if($k_option['mainpage']['blog_widget_exclude'] == 1)
{
$exclude = '&exclude='.$k_option['blog']['blog_cat_final'];
}
?>
<div class='box box_small'>
<h3>Categories</h3>
<ul>
<?php wp_list_cats('sort_column=name&optioncount=0&hiera rchical=0'.$exclude); ?>
</ul>
</div>
<div class='box box_small'>
<h3>Archive</h3>
<ul>
<?php wp_get_archives('type=monthly'); ?>
</ul>
</div>
<?php
//right dummy sidebar
}else { ?>
<div class='box box_small'>
<h3>Pages</h3>
<ul>
<?php wp_list_pages('title_li=' ); ?>
</ul>
</div>
<div class='box box_small'>
<h3>Bloggroll</h3>
<ul>
<?php wp_list_bookmarks('title_li=&categorize=0'); ?>
</ul>
</div>
<?php
}
}
echo "</div>";
}
?>
<?php } ?>
(es tu codigo etiquetado)
En la linea 15 tienes un ejemplo del primer caso. Y entre las lineas 45 y 48 del segundo.
Los siguientes ficheros php son validos y generan exactamente el mismo html
Código PHP:
Ver original<?php //Aqui podrias poner codigo php
?>
<html>
<head>
<title>Documento sin título</title>
</head>
<body>
Hola Mundo
</body>
</html>
Código PHP:
Ver original<?php
echo "<html>";
echo "<head>";
echo "<title>Documento sin título</title>";
echo "</head>";
echo "<body>";
echo "Hola mundo";
echo "</body>";
echo "</html>";
?>
Código PHP:
Ver original<html>
<head>
<title>Documento sin título</title>
</head>
<body>
<?php echo "Hola mundo";?>
</body>
</html>
incluso este si lo guardas como holamundo.php va a funcionar
Código PHP:
Ver original<html>
<head>
<title
>Documento
sin t
í
;tulo
</title
> </head>
<body>
Hola Mundo
</body>
</html>