This question already has an answer here:
Parse error: syntax error, unexpected "<" [closed]
(1 answer)
Closed 9 years ago.
I have a code produced by Joomla that displays an error (see title). I debugged it line by line but don't see any problems. Here is the entire code:
<?php
/**
* #copyright Copyright (C) 2008 - 2009 JoomVision.com. All rights reserved.
* #license GNU/GPL, see LICENSE.php
* Joomla! is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See COPYRIGHT.php for copyright notices and details.
*/
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );
include_once (dirname(__FILE__).DS.'jv_tools.php');
// Javascript
unset($this->_scripts[$this->baseurl . '/media/system/js/mootools.js']);
unset($this->_scripts[$this->baseurl . '/media/system/js/caption.js']);
if($gzip == "true") :
$this->_scripts = array_merge(array($jvTools->templateurl() . 'js/jv.script.js.php' => 'text/javascript'), $this->_scripts);
else:
//$this->_scripts = array_merge(array($jvTools->templateurl() . 'js/jv.collapse.js' => 'text/javascript'), $this->_scripts);
$this->_scripts = array_merge(array($jvTools->templateurl() . 'js/jv.script.js' => 'text/javascript'), $this->_scripts);
$this->_scripts = array_merge(array($jvTools->templateurl() . 'js/mootools.js' => 'text/javascript'), $this->_scripts);
endif;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>">
<head>
<jdoc:include type="head" />
<?php JHTML::_('behavior.mootools'); ?>
<link rel="stylesheet" href="<?php echo $jvTools->baseurl() ; ?>templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $jvTools->baseurl() ; ?>templates/system/css/general.css" type="text/css" />
<?php if($gzip == "true") : ?>
<link rel="stylesheet" href="<?php echo $jvTools->templateurl(); ?>css/template.css.php" type="text/css" />
<?php else: ?>
<link rel="stylesheet" href="<?php echo $jvTools->templateurl(); ?>css/default.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $jvTools->templateurl(); ?>css/template.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $jvTools->templateurl(); ?>css/typo.css" type="text/css" />
<?php endif; ?>
<script type="text/javascript">
var baseurl = "<?php echo $jvTools->baseurl() ; ?>";
var jvpathcolor = '<?php echo $jvTools->templateurl(); ?>css/colors/';
var tmplurl = '<?php echo $jvTools->templateurl();?>';
var CurrentFontSize = parseInt('<?php echo $jvTools;?>') // ->getParam('jv_font');?>');
</script>
<!--[if lte IE 6]>
<link rel="stylesheet" href="<?php echo $jvTools->templateurl(); ?>css/ie6.css" type="text/css" />
<script type="text/javascript" src="<?php echo $jvTools->templateurl() ?>js/ie_png.js"></script>
<script type="text/javascript">
window.addEvent ('load', function() {
ie_png.fix('.png');
});
</script>
<![endif]-->
<!--[if lte IE 7]>
<link rel="stylesheet" href="<?php echo $jvTools->templateurl(); ?>/css/ie7.css" type="text/css" />
<![endif]-->
</head>
<body id="bd" class="fs<?php echo $jvTools->getParam('jv_font'); ?> <?php echo $jvTools->getParam('jv_display'); ?> <?php echo $jvTools->getParam('jv_display_style'); ?>">
<div id="jv-wrapper">
<div id="jv-wrapper-inner">
<div id="jv-header" class="clearfix">
<div class="jv-wrapper">
<div id="jv-header-inner">
<div id="jv-logo">
<h1 class="png"><a href="<?php echo $jvTools->baseurl() ; ?>" title="<?php echo $jvTools->sitename() ; ?>">
<span><?php echo $jvTools->sitename() ; ?></span></a>
</h1>
</div>
<div class="jv-wrapper">
<div id="jv-mainmenu" >
<div id="jv-mainmenu-inner">
<?php if($menustyle == 'split' || $menustyle == 'submoo') : ?>
<?php $menu->show(0,0); ?>
<?php else : ?>
<?php $menu->show(); ?>
<?php endif; ?>
</div>
</div>
<?php if($this->countModules('top')) : ?>
<div id="jv-top" >
<jdoc:include type="modules" name="top" />
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php if($this->countModules('slideshow')) : ?>
<div id="jv-userwrap1" class="clearfix">
<div class="jv-wrapper">
<div id="jv-userwrap1-inner">
<jdoc:include type="modules" name="slideshow" />
</div>
</div>
</div>
<?php endif; ?>
<?php
$spotlight = array ('user1','user2','user3','user4');
$consl = $jvTools->calSpotlight($spotlight,$jvTools->isOP()?100:100,'%');
if( $consl) :
?>
<div id="jv-userwrap2" class="clearfix">
<div class="jv-wrapper">
<div id="jv-userwrap2-inner">
<?php if($this->countModules('user1')) : ?>
<div id="jv-user1" class="jv-user jv-box<?php echo $consl['user1']['class']; ?>" style="width: <?php echo $consl['user1']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user1" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('user2')) : ?>
<div id="jv-user2" class="jv-user jv-box<?php echo $consl['user2']['class']; ?>" style="width: <?php echo $consl['user2']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user2" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('user3')) : ?>
<div id="jv-user3" class="jv-user jv-box<?php echo $consl['user3']['class']; ?>" style="width: <?php echo $consl['user3']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user3" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('user4')) : ?>
<div id="jv-user4" class="jv-user jv-box<?php echo $consl['user4']['class']; ?>" style="width: <?php echo $consl['user4']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user4" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<!-- MAINBODY -->
<div id="jv-mainbody" class="clearfix">
<div class="jv-wrapper">
<!-- CONTAINER -->
<div id="jv-container<?php echo $jv_width;?>" class="clearfix">
<div class="jv-mainbody-inner">
<div class="jv-mainbody-top">
<div class="jv-mainbody-bottom">
<div class="jv-mainbody-inset">
<div id="jv-content">
<div id="jv-content-inner">
<?php if($this->countModules('breadcrumb')) : ?>
<div id="jv-pathway" class="clearfix">
<div id="jv-pathway-inner">
<strong><?php echo JText::_('You are here:')?></strong>
<jdoc:include type="modules" name="breadcrumb" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('user5')) : ?>
<div id="jv-user5" class="clearfix">
<jdoc:include type="modules" name="user5" style="jvxhtml" />
</div>
<?php endif; ?>
<div id="jv-component" class="clearfix">
<jdoc:include type="message" />
<jdoc:include type="component" />
</div>
<?php if($this->countModules('user6')) : ?>
<div id="jv-user6" class="clearfix">
<jdoc:include type="modules" name="user6" style="jvxhtml" />
</div>
<?php endif; ?>
<?php
$spotlight = array ('col1','col2','col3');
$botsl1 = $jvTools->calSpotlight($spotlight,$jvTools->isOP()?100:99,'%');
if( $botsl1 ) :
?>
<div id="jv-userwrap3" class="clearfix">
<div id="jv-userwrap3-inner">
<div class="jv-spotlight">
<?php if($this->countModules('col1')) : ?>
<div id="jv-col1" class="jv-user jv-box<?php echo $botsl1['col1']['class']; ?>" style="width: <?php echo $botsl1['col1']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="col1" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('col2')) : ?>
<div id="jv-col2" class="jv-user jv-box<?php echo $botsl1['col2']['class']; ?>" style="width: <?php echo $botsl1['col2']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="col2" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('col3')) : ?>
<div id="jv-col3" class="jv-user jv-box<?php echo $botsl1['col3']['class']; ?>" style="width: <?php echo $botsl1['col3']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="col3" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
</div>
</div>
<?php if($this->countModules('right')) : ?>
<div id="jv-right">
<div id="jv-right-inner">
<jdoc:include type="modules" name="right" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<br class="clearfix"/>
</div>
<br class="clearfix"/>
</div>
</div>
</div>
<!-- END CONTAINER -->
</div>
</div>
</div>
<!-- END MAINBODY -->
<?php
$spotlight = array ('user7','user8','user9','user10');
$botsl2 = $jvTools->calSpotlight($spotlight,$jvTools->isOP()?100:99, '%');
if( $botsl2 ) :
?>
<div id="jv-userwrap5" class="clearfix">
<div class="jv-wrapper">
<div id="jv-userwrap5-inner">
<div class="jv-spotlight">
<?php if($this->countModules('user7')): ?>
<div id="jv-user7" class="jv-user jv-box<?php echo $botsl2['user7']['class']; ?>" style="width:<?php echo $botsl2['user7']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user7" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('user8')) : ?>
<div id="jv-user8" class="jv-user jv-box<?php echo $botsl2['user8']['class']; ?>" style="width:<?php echo $botsl2['user8']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user8" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('user9')) : ?>
<div id="jv-user9" class="jv-user jv-box<?php echo $botsl2['user9']['class']; ?>" style="width:<?php echo $botsl2['user9']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user9" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('user10')) : ?>
<div id="jv-user10" class="jv-user jv-box<?php echo $botsl2['user10']['class']; ?>" style="width:<?php echo $botsl2['user10']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user10" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
</div>
<?php endif; ?>
<?php
$spotlight = array ('user11','user12','user13','user14');
$botsl3 = $jvTools->calSpotlight ($spotlight,$jvTools->isOP()?100:100,'%');
if( $botsl3 ) :
?>
<div id="jv-userwrap6" class="clearfix">
<div class="jv-wrapper">
<div id="jv-userwrap6-inner">
<?php if($this->countModules('user11')) : ?>
<div id="jv-user11" class="jv-user jv-box<?php echo $botsl3['user11']['class']; ?>" style="width: <?php echo $botsl3['user11']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user11" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('user12')) : ?>
<div id="jv-user12" class="jv-user jv-box<?php echo $botsl3['user12']['class']; ?>" style="width: <?php echo $botsl3['user12']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user12" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('user13')) : ?>
<div id="jv-user13" class="jv-user jv-box<?php echo $botsl3['user13']['class']; ?>" style="width: <?php echo $botsl3['user13']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user13" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
<?php if($this->countModules('user14')) : ?>
<div id="jv-user14" class="jv-user " style="width: <?php echo $botsl3['user14']['width']; ?>;">
<div class="jv-box-inside">
<jdoc:include type="modules" name="user14" style="jvxhtml" />
</div>
</div>
<?php endif; ?>
</div>
</div>
</div>
<?php endif; ?>
<div id="jv-bottom" class="clearfix">
<div id="jv-bottom-inner">
<div id="jv-userwrap7" class="clearfix">
<div class="jv-wrapper">
<div id="jv-userwrap7-inner">
<div id="jv-footer">
<div id="jv-footer-inner"><jdoc:include type="modules" name="footer" /></div>
</div>
<div id="jv-copyright">
<div id="jv-copyright-inner">
Copyright © 2008 - <?php echo date(Y); ?> <a title="Gashon" href="http://www.omrestaurant.ca">Powered</a> by GASHON. All rights reserved.
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<jdoc:include type="modules" name="debug" />
</body>
</html>
Here are a few observations:
in Safari I get a malware warning saying the site may harm my computer, but in IE8 it's fine
the path to the code above is /home/content/93/7079893/html/om/templates/jv_cera/index.php, but the path the website displays when it gives me the error is /home/content/93/7079893/html/om/index.php, as in "Parse error: syntax error, unexpected '<' in /home/content/93/7079893/html/om/index.php on line 105". Could it be that the error is referring to another website?
Line 105 is the last div in this block of code:
<?php if($this->countModules('slideshow')) : ?>
<div id="jv-userwrap1" class="clearfix">
<div class="jv-wrapper">
<div id="jv-userwrap1-inner">
<jdoc:include type="modules" name="slideshow" />
</div>
</div>
</div> // <<-- THIS IS LINE 105
<?php endif; ?>
Can someone please help? Thank you kindly.
If you'd like to check whether the error is referring to another website, add a few pointless HTML lines (like ") ABOVE line 105, then run again. If the error is coming from this page, it the line number should be greater than 105.
Dumb point, but I'm going to mention it anyway: if the error is client side instead of server side, look at the source code that makes it to your browser, not this PHP code.
Related
I'm customizing an HTML template for Joomla! 3.7.2, everything seems work fine except for multilanguage redirect when click on logo.
1) I inser the logo in my index.php file as:
<a id="t-logo" href="<?php echo $this->baseurl; ?>/">
<?php echo $doc->getBuffer('modules', 'logo', array('style' => 'none')); ?>
</a>
Then I use a module to assign the image of the logo in that position (so that my Client can change it easily in future).
Anyway I see that if I switch from main language (IT) to EN and then I click the logo, instead of being redirected to the EN homepage, it always redirects me to the IT homepage. This happens only with my template (tested with default Joomla! Protostar and I don't see this problem).
This is my index.php code:
<?php
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$menu = $app->getMenu();
$doc = JFactory::getDocument();
$user = JFactory::getUser();
...
loading some CSS and JS
...
// Output as HTML5
$this->setHtml5(true);
// Getting params from template
$params = $app->getTemplate(true)->params;
// Detecting Active Variables
$option = $app->input->getCmd('option', '');
$view = $app->input->getCmd('view', '');
$layout = $app->input->getCmd('layout', '');
$task = $app->input->getCmd('task', '');
$itemid = $app->input->getCmd('Itemid', '');
$sitename = $app->get('sitename');
// Aggiunge la classe della pagina
$menu = $app->getMenu()->getActive();
$pageclass = '';
if (is_object($menu))
$pageclass = $menu->params->get('pageclass_sfx');
// fine aggiunge classe della pagina
if($task == "edit" || $layout == "form" )
{
$fullWidth = 1;
}
else
{
$fullWidth = 0;
}
?>
<!DOCTYPE html>
<html lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon" />
<jdoc:include type="head" />
<!--[if lt IE 9]><script src="<?php echo JUri::root(true); ?>/media/jui/js/html5.js"></script><![endif]-->
</head>
<body class="<?php echo $pageclass; ?> site <?php echo $option
. ' view-' . $view
. ($layout ? ' layout-' . $layout : ' no-layout')
. ($task ? ' task-' . $task : ' no-task')
. ($itemid ? ' itemid-' . $itemid : '')
. ($params->get('fluidContainer') ? ' fluid' : '');
echo ($this->direction == 'rtl' ? ' rtl' : '');
?>">
<div class="main-wrapper">
<div class="topbar inner-container container">
<div class="l-sec col-xs-6 col-md-9">
<?php if ($this->countModules('shortinfo')) : ?>
<jdoc:include type="modules" name="shortinfo" style="none" />
<?php endif; ?>
</div>
<div class="r-sec col-xs-6 col-md-3">
<?php if ($this->countModules('language')) : ?>
<jdoc:include type="modules" name="language" style="none" />
<?php endif; ?>
</div>
</div>
<!-- Header Section -->
<header id="main-header">
<div class="inner-container container">
<div class="l-sec col-xs-6 col-sm-6 col-md-3">
<a id="t-logo" href="<?php echo $this->baseurl; ?>/">
<?php echo $doc->getBuffer('modules', 'logo', array('style' => 'none')); ?>
</a>
</div>
<?php if ($this->countModules('main-menu')) : ?>
<div class="r-sec col-xs-6 col-sm-6 col-md-9">
<nav id="main-menu" class="navigation" role="navigation">
<jdoc:include type="modules" name="main-menu" style="none" />
</nav>
<div id="main-menu-handle" class="ravis-btn btn-type-2"><i class="fa fa-bars"></i><i class="fa fa-close"></i></div><!-- Mobile Menu handle -->
<?php if ($this->countModules('bookingbutton')) : ?>
<jdoc:include type="modules" name="bookingbutton" style="none" />
<?php endif; ?>
</div>
<?php endif; ?>
</div>
<div id="mobile-menu-container"></div>
</header>
<!-- End of Header Section -->
<?php if ($this->countModules('header')) : ?>
<section id="breadcrumb-section" data-bg-img="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/images/header.jpg" style="background-image: url('<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/images/header.jpg');">
<div class="inner-container container">
<div class="ravis-title">
<div class="inner-box">
<div class="title">
<h1 itemprop="headline">
<?php echo $page_title = $doc->getTitle(); ?>
</h1>
</div>
<div class="sub-title"><h2 class="great-vibes"><?php echo htmlspecialchars($images->image_intro_alt); ?></h2></div>
</div>
</div>
<div class="breadcrumb">
<?php
$modules =& JModuleHelper::getModules('breadcrumb');
foreach ($modules as $module)
{
echo JModuleHelper::renderModule($module);
}
?>
</div>
</div>
</section>
<?php endif; ?>
<?php if ($this->countModules('main-slider')) : ?>
<div class="slider-available-sec">
<jdoc:include type="modules" name="main-slider" style="none" />
<?php if ($this->countModules('booking-form')) : ?>
<jdoc:include type="modules" name="booking-form" style="none" />
<?php endif; ?>
</div>
<?php endif; ?>
<jdoc:include type="message" />
<div class="componentarea">
<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
$lang = JFactory::getLanguage();
if ($menu->getActive() != $menu->getDefault($lang->getTag())) : ?>
<jdoc:include type="component" />
<?php endif; ?>
</div>
<?php if ($this->countModules('welcome')) : ?>
<jdoc:include type="modules" name="welcome" style="none" />
<?php endif; ?>
<?php if ($this->countModules('luxury-rooms')) : ?>
<jdoc:include type="modules" name="luxury-rooms" style="none" />
<?php endif; ?>
<?php if ($this->countModules('events')) : ?>
<jdoc:include type="modules" name="events" style="none" />
<?php endif; ?>
<?php if ($this->countModules('services')) : ?>
<jdoc:include type="modules" name="services" style="none" />
<?php endif; ?>
<?php if ($this->countModules('tour')) : ?>
<jdoc:include type="modules" name="tour" style="none" />
<?php endif; ?>
<?php if ($this->countModules('gallery')) : ?>
<jdoc:include type="modules" name="gallery" style="none" />
<?php endif; ?>
<?php if ($this->countModules('testimonials')) : ?>
<jdoc:include type="modules" name="testimonials" style="none" />
<?php endif; ?>
<?php if ($this->countModules('pacchetti')) : ?>
<jdoc:include type="modules" name="pacchetti" style="none" />
<?php endif; ?>
<?php if ($this->countModules('richiesta')) : ?>
<jdoc:include type="modules" name="richiesta" style="none" />
<?php endif; ?>
<!--Footer Section-->
<footer id="main-footer">
<div class="inner-container container">
<div class="t-sec clearfix">
<?php if ($this->countModules('footer-1')) : ?>
<jdoc:include type="modules" name="footer-1" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules('footer-2')) : ?>
<jdoc:include type="modules" name="footer-2" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules('footer-3')) : ?>
<jdoc:include type="modules" name="footer-3" style="xhtml" />
<?php endif; ?>
<?php if ($this->countModules('footer-4')) : ?>
<jdoc:include type="modules" name="footer-4" style="xhtml" />
<?php endif; ?>
</div>
<?php if ($this->countModules('copyright')) : ?>
<jdoc:include type="modules" name="copyright" style="none" />
<?php endif; ?>
</div>
</footer>
<!--End of Footer Section-->
</div>
</body>
</html>
Any suggestion and how to fix this?
Thanks in advance!
Here's some code I use for one of our templates, it would be easy to adapt this to your situation:
<?php
$app = JFactory::getApplication();
$lang = JFactory::getLanguage();
if ($this->language ==’en-gb’){
echo ‘<a href=”‘ .$this->baseurl .’/en” class=”” title=””>’;
}
else {
echo ‘<a href=”‘ .$this->baseurl .’/fr” class=”” title=””>’;
}
?>
<img class=”logo” src=”/path/images/header/logo.png” alt=””>
<?php
echo “</a>”;
?>
I have a little problem with aligning a logo with some text in wordpress.
The more transparent logo is where I want my logo to be. It is in my header.php in my wordpress theme "Creator World".
I Really dont know what to do I have tried to research and I couldn't find anything. Hope you can help me 😀
The more transparent logo and the arrow is sat in, in an design app
Here is my php code for my header.php in wordpress
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div class="container">
*
* #package Creator World
*/
?>
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="profile" href="http://gmpg.org/xfn/11">
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="pagewrap">
<div class="headertop">
<div class="container">
<?php if ( ! dynamic_sidebar( 'header-info' ) ) : ?>
<?php endif; // end header widget area ?>
</div><!-- .container -->
</div><!-- .headertop -->
<div class="header">
<div class="container">
<div class="logo">
<?php creator_world_the_custom_logo(); ?>
<h1><a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php bloginfo('name'); ?>
</a></h1>
<p>
<?php bloginfo('description'); ?>
</p>
</div><!-- logo -->
<div class="toggle"> <a class="toggleMenu" href="#">
<?php _e('Menu','creator-world'); ?>
</a> </div> <!-- toggle -->
<div class="sitenav">
<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
</div>
<!-- site-nav -->
<div class="clear"></div>
</div><!-- container -->
</div><!--.header -->
<?php if ( is_front_page() && !is_home() ) { ?>
<?php $hideslide = get_theme_mod('disabled_slides', '1'); ?>
<?php if($hideslide == ''){ ?>
<?php for($sld=7; $sld<10; $sld++) { ?>
<?php if( get_theme_mod('page-setting'.$sld)) { ?>
<?php $slidequery = new WP_query('page_id='.get_theme_mod('page-setting'.$sld,true)); ?>
<?php while( $slidequery->have_posts() ) : $slidequery->the_post();
$image = wp_get_attachment_url( get_post_thumbnail_id($post->ID));
$img_arr[] = $image;
$id_arr[] = $post->ID;
endwhile;
}
}
?>
<?php if(!empty($id_arr)){ ?>
<div id="slider" class="nivoSlider">
<?php
$i=1;
foreach($img_arr as $url){ ?>
<?php if(!empty($url)){ ?>
<img src="<?php echo $url; ?>" title="#slidecaption<?php echo $i; ?>" />
<?php }else{ ?>
<img src="<?php echo esc_url( get_template_directory_uri() ) ; ?>/images/slides/slider-default.jpg" title="#slidecaption<?php echo $i; ?>" />
<?php } ?>
<?php $i++; } ?>
</div>
<?php
$i=1;
foreach($id_arr as $id){
$title = get_the_title( $id );
$post = get_post($id);
$content = esc_html( wp_trim_words( $post->post_content, 20, '' ) );
?>
<div id="slidecaption<?php echo $i; ?>" class="nivo-html-caption">
<div class="slide_info">
<h2><?php echo $title; ?></h2>
<p><?php echo $content; ?></p>
</div>
</div>
<?php $i++; } ?>
<?php wp_reset_postdata(); ?>
<div class="clear"></div>
<?php } ?>
<?php } } ?>
<?php if ( is_front_page() && ! is_home() ) { ?>
<?php $hidewelcome = get_theme_mod('disabled_welcome', '1'); ?>
<?php if($hidewelcome == ''){ ?>
<section id="welcomesection">
<div class="container">
<div class="welcomebx">
<?php if( get_theme_mod('page-setting1')) { ?>
<?php $queryvar = new WP_query('page_id='.get_theme_mod('page-setting1' ,true)); ?>
<?php while( $queryvar->have_posts() ) : $queryvar->the_post();?>
<h2 class="headingtitle">
<?php the_title(); ?>
</h2>
<?php the_content(); ?>
<div class="clear"></div>
<?php endwhile;
wp_reset_postdata(); ?>
<?php } ?>
</div> <!-- welcomewrap-->
<div class="clear"></div>
</div> <!-- container -->
</section>
<?php } ?>
<?php $hidepgbxes = get_theme_mod('disabled_pageboxes', '1'); ?>
<?php if($hidepgbxes == ''){ ?>
<section id="wrapsecond">
<div class="container">
<div class="services-wrap">
<?php for($p=1; $p<5; $p++) { ?>
<?php if( get_theme_mod('page-column'.$p,false)) { ?>
<?php $querymy = new WP_query('page_id='.get_theme_mod('page-column'.$p,true)); ?>
<?php while( $querymy->have_posts() ) : $querymy->the_post(); ?>
<div class="fourbox <?php if($p % 4 == 0) { echo "last_column"; } ?>">
<?php if(has_post_thumbnail() ) { ?>
<div class="thumbbx"><?php the_post_thumbnail();?> </div>
<?php } ?>
<div class="pagecontent">
<h3><?php the_title(); ?></h3>
<p><?php echo wp_trim_words( get_the_content(), 20, '...' ); ?></p>
<a class="pagemore" href="<?php the_permalink(); ?>">
<?php _e('Read More','creator-world'); ?>
</a>
</div>
</div>
<?php endwhile;
wp_reset_postdata(); ?>
<?php } } ?>
<div class="clear"></div>
</div> <!-- services-wrap-->
</div> <!-- container -->
</section>
<?php } ?>
<?php } ?>
You can't center a logo through php. The right way will be css. Search by css and you will find many ways to achieve this. Or post the link of your site so that we can help you.
Try changing the code to the following, adding a new div with class brand-name and leaving only the logo in the one with logo class.
<div class="header">
<div class="container">
<div class="brand-name">
<h1><a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php bloginfo('name'); ?>
</a></h1>
<p>
<?php bloginfo('description'); ?>
</p>
</div>
<div class="logo">
<?php creator_world_the_custom_logo(); ?>
</div><!-- logo -->
<div class="toggle"> <a class="toggleMenu" href="#">
<?php _e('Menu','creator-world'); ?>
</a> </div> <!-- toggle -->
<div class="sitenav">
<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
</div>
<!-- site-nav -->
<div class="clear"></div>
</div><!-- container -->
</div><!--.header -->
Then, add the following lines in CSS:
.brand-name, .logo {
display: inline-block;
}
try wrapping the logo and title to the individual div elements
<div class="header">
<div class="container">
<div class="brand-title pull-left">
<h1><a href="<?php echo esc_url( home_url( '/' ) ); ?>">
<?php bloginfo('name'); ?>
</a></h1>
<p>
<?php bloginfo('description'); ?>
</p>
</div><!-- Brand Title -->
<div class="brand-logo pull-left">
<?php creator_world_the_custom_logo(); ?>
</div><!-- Brand logo -->
<div class="toggle"> <a class="toggleMenu" href="#">
<?php _e('Menu','creator-world'); ?>
</a> </div> <!-- toggle -->
<div class="sitenav">
<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
</div>
<!-- site-nav -->
<div class="clear"></div>
</div><!-- container -->
</div><!--.header -->
and then add the following code to your CSS file (usually this is style.css)
.pull-left {
float: left;
}
With some struggle i setup an test area and updated the joomla template of an customer.
I used JUpdate for this.
The template is custom and i rebuild it from 1.5 for the use in 2.5.
The original site http://imgdump.nl/hosted/7a5613219515d86549301252eca2837e.png
The site in the updated joomla http://imgdump.nl/hosted/ef214bab43ee5508798d84cee7d2d6fb.png
Does anyone know what couses this to happen ? is it in updating the template or is it anything else?
Also tried if the menu structure is still working and as far as i can see its still all linked.
If its a great possibility its becourse of the template code i will post it later.
I dont got an PARAM section in the 1.5 template could this mess it up if i try to convert it to 2.5 ? (i got an POSITION section with the sections of the site)
<files>
<filename>index.php</filename>
<filename>templateDetails.xml</filename>
<filename>template_thumbnail.png</filename>
<filename>templates.php</filename>
<filename>template_preview.png</filename>
<filename>error.php</filename>
<folder>css</folder>
<folder>images</folder>
</files>
<positions>
<position>user4</position>
<position>user3</position>
<position>breadcrumb</position>
<position>user2</position>
<position>left</position>
<position>right</position>
<position>debug</position>
</positions>
<body id="page_bg">
<div id="container">
<?php if($this->countModules('user4') and JRequest::getCmd('layout') != 'form') : ?>
<div id="search_bg">
<div id="search">
<jdoc:include type="modules" name="user4" />
</div>
</div>
<?php else: ?>
<div id="nosearch"></div>
<?php endif; ?>
<div id="pillmenu">
<jdoc:include type="modules" name="user3" />
<jdoc:include type="modules" name="breadcrumb" />
<div id="outside"></div>
</div>
<div id="header">
<div id="headerimg"></div>
<table cellpadding="0" cellspacing="0">
<tr>
<td>
<h1><!-- <?php echo $mainframe->getCfg('sitename') ;?><!--test--></h1>
</td>
</tr>
</table>
<div class="boxes">
<jdoc:include type="modules" style="rounded" name="user2" />
</div>
</div>
<div id="content">
<div id="content_top">
<div id="content_bottom">
<?php if($this->countModules('left') and JRequest::getCmd('layout') != 'form') : ?>
<div id="leftcolumn">
<jdoc:include type="modules" name="left" style="rounded" />
<br /><?php $sg = "banner"; include "templates.php"; ?><br />
</div>
<?php endif; ?>
<?php if($this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
<div id="maincolumn">
<?php else: ?>
<div id="maincolumn_full">
<?php endif; ?>
<div class="nopad">
<jdoc:include type="message" />
<?php if($this->params->get('showComponent')) : ?>
<jdoc:include type="component" />
<?php endif; ?>
</div>
</div>
<?php if($this->countModules('right') and JRequest::getCmd('layout') != 'form') : ?>
<div id="rightcolumn" style="float:right;">
<jdoc:include type="modules" name="right" style="rounded" />
</div>
<?php endif; ?>
<div class="clr"></div>
<jdoc:include type="modules" name="debug" />
</div>
</div>
</div>
This question already has answers here:
why do my recent post titles replace the page title i am posting on [closed]
(2 answers)
Closed 9 years ago.
Hi guys i posted a question earlier about how my blog posts kept replacing my page titles in wordpress
https://stackoverflow.com/questions/20541544/why-do-my-recent-post-titles-replace-the-page-title-i-am-posting-on/20542610?noredirect=1#20542610
but i did not understand the way my questions were answered as i have no php experience so i thought id post my code here so if anyone could pin point were in the wordpress code it has a fault ?
this is the code for the page in which its title "Latest News" is being replaced
<?php
/**
* The template for displaying all pages.
*
* This is the template that displays all pages by default.
* Please note that this is the wordpress construct of pages
* and that other 'pages' on your wordpress site will use a
* different template.
*
*/
?>
<?php get_header(); ?>
<div class="page-heading">
<h1 class="page-title"><?php the_title(); ?></h1>
<div class="clear"></div>
</div>
<!--Start Page Content -->
<div class="page-content-container">
<div class="page-content">
<div class="grid_16 alpha">
<div class="content-bar">
<?php if (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<div class="clear"></div>
<?php wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', 'black-bird') . '</span>', 'after' => '</div>')); ?>
<?php endif; ?>
<!--Start Comment box-->
<?php comments_template(); ?>
<!--End Comment box-->
</div>
</div>
<div class="grid_8 omega">
<!--Start Sidebar-->
<?php get_sidebar(); ?>
<!--End Sidebar-->
</div>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
and this is the code for the posts of which each new post title replaces the page title
<?php
/**
* The Template for displaying all single posts.
*
*/
?>
<?php get_header(); ?>
<!--Start Page Heading-->
<!--Start Page Content -->
<div class="page-content-container">
<div class="page-content single">
<div class="grid_16 alpha">
<div class="content-bar">
<!-- Start the Loop. -->
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<!--post start-->
<div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<div class="post_content">
<?php the_content(); ?>
<div class="clear"></div>
<h1 class="post_title single" ><span><?php the_title(); ?><span></h1>
<?php wp_link_pages(array('before' => '<div class="page-link"><span>' . __('Pages:', 'black-bird') . '</span>', 'after' => '</div>')); ?>
<?php if (has_tag()) { ?>
<div class="tag">
<?php the_tags(__('Post Tagged with ', ', ', '')); ?>
</div>
<?php } ?>
</div>
<ul class="post_meta clearfix">
<li class="posted_by"><span><?php _e('Posted by', 'black-bird'); ?></span> <img src="<?php echo get_template_directory_uri(); ?>/images/admin.png" /><?php the_author_posts_link(); ?></li>
<li class="post_category"><span><?php _e('Posted in', 'black-bird'); ?></span> <?php the_category(', '); ?></li>
<li class="post_date"><img src="<?php echo get_template_directory_uri(); ?>/images/date.png" /> <?php echo get_the_time('M, d, Y') ?></li>
<li class="post_comment"><img src="<?php echo get_template_directory_uri(); ?>/images/comment.png" /> <span><?php comments_popup_link('No Comments.', '1 Comment.', '% Comments.'); ?></span></li>
</ul>
</div>
<!--End Post-->
<?php
endwhile;
else:
?>
<div class="post">
<p>
<?php _e('Sorry, no posts matched your criteria.', 'black-bird'); ?>
</p>
</div>
<?php endif; ?>
<!--End Loop-->
<nav id="nav-single"> <span class="nav-previous">
<?php previous_post_link('%link', __('<span class="meta-nav">←</span> Previous Post ', 'black-bird')); ?>
</span> <span class="nav-next">
<?php next_post_link('%link', __('Next Post <span class="meta-nav">→</span>', 'black-bird')); ?>
</span> </nav>
<!--Start Comment box-->
<?php comments_template(); ?>
<!--End Comment box-->
</div>
</div>
<div class="grid_8 omega">
<!--Start sidebar-->
<?php get_sidebar(); ?>
<!--End sidebar-->
</div>
</div>
</div>
</div>
</div>
</div>
<?php get_footer(); ?>
also this is the code for the header file
<?php
/**
* The Header for our theme.
*
* Displays all of the <head> section and everything up till <div id="main">
*
*/
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title><?php wp_title(''); ?></title>
<link rel="profile" href="http://gmpg.org/xfn/11" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="stylesheet" type="text/css" media="all" href="<?php bloginfo('stylesheet_url'); ?>" />
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?> style="<?php if (blackbird_get_option('blackbird_bodybg') != '') { ?>background: fixed url(<?php echo blackbird_get_option('blackbird_bodybg'); ?>);<?php } else {
?> background: fixed url(<?php echo get_template_directory_uri(); ?>/images/bg.jpg); <?php } ?>" >
<div class="main-container">
<div class="container_24">
<div class="grid_24">
<div class="header">
<div class="grid_16 alpha">
<div class="logo"> <img src="<?php if (blackbird_get_option('blackbird_logo') != '') { ?><?php echo blackbird_get_option('blackbird_logo'); ?><?php } else { ?><?php echo get_template_directory_uri(); ?>/images/logo.png<?php } ?>" alt="<?php bloginfo('name'); ?>" /></div>
</div>
<div class="grid_8 omega">
<div class="header-info">
<?php if (blackbird_get_option('blackbird_topright_cell') != '') { ?>
<p class="cell"><img src="<?php echo get_template_directory_uri(); ?>/images/call-us.png" class="call-us" /> <?php echo stripslashes(blackbird_get_option('blackbird_topright_cell')); ?></p>
<?php } else { ?>
<p class="cell"><img src="<?php echo get_template_directory_uri(); ?>/images/call-us.png" class="call-us" /> Call Us (111) 234 - 5678</p>
<?php } ?>
<?php if (blackbird_get_option('blackbird_topright_text') != '') { ?>
<p><?php echo stripslashes(blackbird_get_option('blackbird_topright_text')); ?></p>
<?php } else { ?>
<p><?php _e('21/B, London Campus, British Road, Birmingham, UK','black-bird'); ?></p>
<?php } ?>
</div>
</div>
</div>
<div class="clear"></div>
<!--start Menu wrapper-->
<div class="menu_wrapper">
<div class="grid_18 alpha">
<div id="MainNav">
<?php _e('Pages Navigation Menu','black-bird'); ?><span></span>
<?php blackbird_nav(); ?>
</div></div>
<div class="grid_6 omega">
<div class="top-search">
<?php get_search_form(); ?>
</div>
</div>
</div>
<!--End Menu wrapper-->
<div class="clear"></div>
so guys what do I need to alter and were in order for each post title to stop replacing the page title?
This bit of code:
<h1 class="post_title single"
Will print whatever the post title is. YOu can try replacing it with
<h1><?php wp_title(''); ?></h1>
To get the page title, or with
$parent_title = get_the_title($post->post_parent);
echo '<h1>' . $parent_title . '</h1>';
To get the parent page title
In order to test if the converted index.haml would work on with my wamp and localhost i did the following:
First, I renamed my index.php into index.html
Then, I typed html2haml index.html index.haml in the command line
Then, I typed haml index.haml indexnew.html in the command line
I renamed indexnew.html to indexnew.php
I tested it: localhost/projects/cross-browser/base0.9/indexnew.php
but the indexnew.php was rendered blank even if the code inside is ok:
Original Php (index.php):
<?php
include_once 'localization.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
<title>Alex Chen - Web Development, Graphic Design, and Translation</title>
<link rel="stylesheet" type="text/css" href="styles/reset.css" />
<link rel="stylesheet" type="text/css" href="styles/global.css" />
<link rel="stylesheet" type="text/css" href="fancybox/jquery.fancybox-1.3.1.css" />
<?php if($lang_file=='lang.zh-tw.php' || $lang_file=='lang.zh-cn.php') {echo '<link rel="stylesheet" type="text/css" href="styles/chinese.css" />';} ?>
<script type="text/javascript" src="scripts/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="scripts/jquery.validate.js"></script>
<script type="text/javascript" src="fancybox/jquery.fancybox-1.3.1.pack.js"></script>
<script type="text/javascript" src="scripts/jquery.scrollTo-min.js"></script>
<script type="text/javascript" src="scripts/jquery.localscroll-min.js"></script>
<script type="text/javascript" src="scripts/custom.js"></script>
<?php if($lang_file=='lang.en.php') {echo '<script type="text/javascript" src="scripts/jquery-validate/val-en.js"></script>';} ?>
<?php if($lang_file=='lang.es.php') {echo '<script type="text/javascript" src="scripts/jquery-validate/val-es.js"></script>';} ?>
<?php if($lang_file=='lang.zh-tw.php') {echo '<script type="text/javascript" src="scripts/jquery-validate/val-zh-tw.js"></script>';} ?>
<?php if($lang_file=='lang.zh-cn.php') {echo '<script type="text/javascript" src="scripts/jquery-validate/val-zh-cn.js"></script>';} ?>
</head>
<body id="home">
<div id="header">
<div class="container">
<div id="banner">
<ul id="lang">
<li <?php if($lang_file=='lang.en.php') {echo 'class="current"';} ?>>ENGLISH</li>
<li <?php if($lang_file=='lang.es.php') {echo 'class="current"';} ?>><?php echo l('nav_a0'); ?></li>
<li <?php if($lang_file=='lang.zh-tw.php') {echo 'class="current"';} ?>><?php echo l('nav_a1'); ?></li>
<li <?php if($lang_file=='lang.zh-cn.php') {echo 'class="current"';} ?>><?php echo l('nav_a2'); ?></li>
</ul>
<div id="logo">
<h1><a>ALEXCHEN</a></h1>
</div>
<div id="logo2">
<ul id="nav">
<li><?php echo l('nav1'); ?></li>
<li><?php echo l('nav2'); ?></li>
</ul>
</div>
<div id="logo3">
</div>
</div><!-- #header-bottom -->
</div><!-- .container -->
</div><!-- #header -->
<div id="content">
<div class="container">
<div class="showcase">
<div class="first">
<div id="nopic">
<p><?php echo l('tagline_p'); ?></p>
</div>
</div>
<div class="pusher">
<h3><?php echo l('showcase1_h3'); ?></h3>
<p><?php echo l('showcase1_p'); ?></p>
<div class="pic">
<a id="showcase1" href="#inline1"><img src="images/showcase1t.png"/></a>
<div id="inline1">
<img src="images/showcase1.png"/>
studyatbest.com
</div>
</div>
</div>
<div class="pusher">
<h3><?php echo l('showcase2_h3'); ?></h3>
<p><?php echo l('showcase2_p'); ?></p>
<div class="pic">
<a id="showcase2" href="#inline2"><img src="images/showcase2t.png"/></a>
<div id="inline2">
<img src="images/showcase2.png"/>
spacestudios.com
</div>
</div>
</div><!-- .pushed -->
<div class="pusher">
<h3><?php echo l('showcase3_h3'); ?></h3>
<p><?php echo l('showcase3_p'); ?></p>
<div class="pic">
<a id="showcase3" href="#inline3"><img src="images/showcase3t.png"/></a>
<div id="inline3">
<img src="images/showcase3.png"/>
alexchen.com
</div>
</div>
</div>
<div class="pusher">
<h3><?php echo l('showcase4_h3'); ?></h3>
<p><?php echo l('showcase4_p'); ?></p>
<div class="pic">
<a id="showcase4" href="#inline4"><img src="images/showcase4t.png"/></a>
<div id="inline4">
<img src="images/showcase4.png"/>
mattsai.com
</div>
</div>
</div>
<div class="pusher">
<h3><?php echo l('showcase5_h3'); ?></h3>
<p><?php echo l('showcase5_p'); ?></p>
<div class="pic">
<a id="showcase5" href="#inline5"><img src="images/showcase5t.png"/></a>
<div id="inline5">
<img src="images/showcase5.png"/>
mattsai.com
</div>
</div>
</div><!-- .pusher -->
<div class="pusher">
<h3><?php echo l('showcase6_h3'); ?></h3>
<p><?php echo l('showcase6_p'); ?></p>
<div class="pic">
<a id="showcase6" href="#inline6"><img src="images/showcase6t.png"/></a>
<div id="inline6">
<img src="images/showcase6.png"/>
mattsai.com
</div>
</div>
</div>
<div class="pusher">
<h3><?php echo l('showcase8_h3'); ?></h3>
<p><?php echo l('showcase8_p'); ?></p>
<div class="pic">
<a id="showcase8" href="#inline8"><img src="images/showcase8t.png"/></a>
<div id="inline8">
<img src="images/showcase8.png"/>
mattsai.com
</div>
</div>
</div><!-- .pusher -->
</div><!-- .showcase -->
</div><!-- .container -->
</div><!-- #work -->
<div id="footer">
<div class="container">
<div id="footer-top">
<div id="about">
<h3><?php echo l('about_h3'); ?></h3>
<p><?php echo l('about_p'); ?></p>
</div>
<div id="info">
<h3><?php echo l('info_h3'); ?></h3>
<ul>
<li id="tel"><?php echo l('_info_li2'); ?><p>Tel:</p> 0918051170</li>
<li id="gmail"><?php echo l('_info_li3'); ?><p></p>alexchen.net#gmail.com</li>
<li id="facebook"><?php echo l('_info_li4'); ?> facebook</li>
</ul>
</div>
<div id="contact">
<h3><?php echo l('contact_h3'); ?></h3>
<p><?php echo l('_contact_p'); ?></p>
<form id="sendmail" method="post" action="http://www.emailmeform.com/fid.php?formid=254816">
<label for="name"><?php echo l('form_label1'); ?></label>
<input type="text" id="name" name="FieldData0" />
<label for="email"><?php echo l('form_label2'); ?></label>
<input type="text" id="email" name="FieldData1" />
<label for="message"><?php echo l('form_label3'); ?></label>
<textarea type="text" id="message" name="FieldData2"></textarea>
<input id="button" type="submit" value="<?php echo l('submit'); ?>">
</form>
</div>
</div><!-- #footer-top -->
<div id="footer-bottom">
<p>Copyright © 2010 Alex Chen. All Rights Reserved. Hosted on Zymic. Contact form hosted on Email Me Form.<a id="nr" href="http://www.freedomain.co.nr/cheap_web_hosting.php" target="_blank"><img src="http://ruarmza.4u.com.ru/ch.gif" alt="Cheap Web Hosting Providers" width="88" height="31" border="0" /></a></p>
</div>
</div><!-- .container -->
</div><!-- #footer -->
<script type="text/javascript" src="scripts/google-analytics.js"></script>
<script type="text/javascript" src="scripts/page-tracker.js"></script>
</body>
</html>
Converted Php (indexnew.php):
<?php include_once 'localization.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta content='text/html; charset=utf-8' http-equiv='Content-Type' />
<meta content='IE=EmulateIE7' http-equiv='X-UA-Compatible' />
<title>Alex Chen - Web Development, Graphic Design, and Translation</title>
<link href='styles/reset.css' rel='stylesheet' type='text/css' />
<link href='styles/global.css' rel='stylesheet' type='text/css' />
<link href='fancybox/jquery.fancybox-1.3.1.css' rel='stylesheet' type='text/css' />
<?php if($lang_file=='lang.zh-tw.php' || $lang_file=='lang.zh-cn.php') {echo '<link rel="stylesheet" type="text/css" href="styles/chinese.css" ?>
';} ?>
<script src='scripts/jquery-1.3.2.min.js' type='text/javascript'></script>
<script src='scripts/jquery.validate.js' type='text/javascript'></script>
<script src='fancybox/jquery.fancybox-1.3.1.pack.js' type='text/javascript'></script>
<script src='scripts/jquery.scrollTo-min.js' type='text/javascript'></script>
<script src='scripts/jquery.localscroll-min.js' type='text/javascript'></script>
<script src='scripts/custom.js' type='text/javascript'></script>
<?php if($lang_file=='lang.en.php') {echo '<script type="text/javascript" src="scripts/jquery-validate/val-en.js?>
';} ?>
<?php if($lang_file=='lang.es.php') {echo '<script type="text/javascript" src="scripts/jquery-validate/val-es.js?>
';} ?>
<?php if($lang_file=='lang.zh-tw.php') {echo '<script type="text/javascript" src="scripts/jquery-validate/val-zh-tw.js?>
';} ?>
<?php if($lang_file=='lang.zh-cn.php') {echo '<script type="text/javascript" src="scripts/jquery-validate/val-zh-cn.js?>
';} ?>
</head>
<body id='home'>
<div id='header'>
<div class='container'>
<div id='banner'>
<ul id='lang'>
<li
<?php if($lang_file=='lang.en.php') {echo 'class="current"';} ?>
>
</ul>
<a href='index.php?lang=en'>ENGLISH</a>
<li
<?php if($lang_file=='lang.es.php') {echo 'class="current"';} ?>
>
<a href='index.php?lang=es'>
<?php echo l('nav_a0'); ?>
</a>
<li
<?php if($lang_file=='lang.zh-tw.php') {echo 'class="current"';} ?>
>
<a href='index.php?lang=zh-tw'>
<?php echo l('nav_a1'); ?>
</a>
<li
<?php if($lang_file=='lang.zh-cn.php') {echo 'class="current"';} ?>
>
<a href='index.php?lang=zh-cn'>
<?php echo l('nav_a2'); ?>
</a>
<div id='logo'>
<h1>
<a>ALEXCHEN</a>
</h1>
</div>
<div id='logo2'>
<ul id='nav'>
<li>
<a href='#content'>
<?php echo l('nav1'); ?>
</a>
</li>
<li>
<a href='#contact'>
<?php echo l('nav2'); ?>
</a>
</li>
</ul>
</div>
<div id='logo3'></div>
</div>
<!-- #header-bottom -->
</div>
<!-- .container -->
</div>
<!-- #header -->
<div id='content'>
<div class='container'>
<div class='showcase'>
<div class='first'>
<div id='nopic'>
<p>
<?php echo l('tagline_p'); ?>
</p>
</div>
</div>
<div class='pusher'>
<h3>
<?php echo l('showcase1_h3'); ?>
</h3>
<p>
<?php echo l('showcase1_p'); ?>
</p>
<div class='pic'>
<a href='#inline1' id='showcase1'>
<img src='images/showcase1t.png' />
</a>
<div id='inline1'>
<img src='images/showcase1.png' />
<a href='http://studyatbest.com'>studyatbest.com</a>
</div>
</div>
</div>
<div class='pusher'>
<h3>
<?php echo l('showcase2_h3'); ?>
</h3>
<p>
<?php echo l('showcase2_p'); ?>
</p>
<div class='pic'>
<a href='#inline2' id='showcase2'>
<img src='images/showcase2t.png' />
</a>
<div id='inline2'>
<img src='images/showcase2.png' />
<a href='http://studyatbes.com'>spacestudios.com</a>
</div>
</div>
</div>
<!-- .pushed -->
<div class='pusher'>
<h3>
<?php echo l('showcase3_h3'); ?>
</h3>
<p>
<?php echo l('showcase3_p'); ?>
</p>
<div class='pic'>
<a href='#inline3' id='showcase3'>
<img src='images/showcase3t.png' />
</a>
<div id='inline3'>
<img src='images/showcase3.png' />
<a href='http://studyatbes.com'>alexchen.com</a>
</div>
</div>
</div>
<div class='pusher'>
<h3>
<?php echo l('showcase4_h3'); ?>
</h3>
<p>
<?php echo l('showcase4_p'); ?>
</p>
<div class='pic'>
<a href='#inline4' id='showcase4'>
<img src='images/showcase4t.png' />
</a>
<div id='inline4'>
<img src='images/showcase4.png' />
<a href='http://studyatbes.com'>mattsai.com</a>
</div>
</div>
</div>
<div class='pusher'>
<h3>
<?php echo l('showcase5_h3'); ?>
</h3>
<p>
<?php echo l('showcase5_p'); ?>
</p>
<div class='pic'>
<a href='#inline5' id='showcase5'>
<img src='images/showcase5t.png' />
</a>
<div id='inline5'>
<img src='images/showcase5.png' />
<a href='http://studyatbes.com'>mattsai.com</a>
</div>
</div>
</div>
<!-- .pusher -->
<div class='pusher'>
<h3>
<?php echo l('showcase6_h3'); ?>
</h3>
<p>
<?php echo l('showcase6_p'); ?>
</p>
<div class='pic'>
<a href='#inline6' id='showcase6'>
<img src='images/showcase6t.png' />
</a>
<div id='inline6'>
<img src='images/showcase6.png' />
<a href='http://studyatbes.com'>mattsai.com</a>
</div>
</div>
</div>
<div class='pusher'>
<h3>
<?php echo l('showcase8_h3'); ?>
</h3>
<p>
<?php echo l('showcase8_p'); ?>
</p>
<div class='pic'>
<a href='#inline8' id='showcase8'>
<img src='images/showcase8t.png' />
</a>
<div id='inline8'>
<img src='images/showcase8.png' />
<a href='http://studyatbes.com'>mattsai.com</a>
</div>
</div>
</div>
<!-- .pusher -->
</div>
<!-- .showcase -->
</div>
<!-- .container -->
</div>
<!-- #work -->
<div id='footer'>
<div class='container'>
<div id='footer-top'>
<div id='about'>
<h3>
<?php echo l('about_h3'); ?>
</h3>
<p>
<?php echo l('about_p'); ?>
</p>
</div>
<div id='info'>
<h3>
<?php echo l('info_h3'); ?>
</h3>
<ul>
<li id='tel'>
<?php echo l('_info_li2'); ?>
<p>Tel:</p>
0918051170
</li>
<li id='gmail'>
<?php echo l('_info_li3'); ?>
<p></p>
<a href='mailto:janoochen#gmail.com'>alexchen.net#gmail.com</a>
</li>
<li id='facebook'>
<?php echo l('_info_li4'); ?>
<a href='http://www.facebook.com/weedd.chen'>facebook</a>
</li>
</ul>
</div>
<div id='contact'>
<h3>
<?php echo l('contact_h3'); ?>
</h3>
<p>
<?php echo l('_contact_p'); ?>
</p>
<form action='http://www.emailmeform.com/fid.php?formid=254816' id='sendmail' method='post'>
<label for='name'>
<?php echo l('form_label1'); ?>
</label>
<input id='name' name='FieldData0' type='text' />
<label for='email'>
<?php echo l('form_label2'); ?>
</label>
<input id='email' name='FieldData1' type='text' />
<label for='message'>
<?php echo l('form_label3'); ?>
</label>
<textarea id='message' name='FieldData2' type='text'></textarea>
<input id='button' type='submit' value="<?php echo l('submit'); ?>" />
</form>
</div>
</div>
<!-- #footer-top -->
<div id='footer-bottom'>
<p>
Copyright © 2010 Alex Chen. All Rights Reserved. Hosted on
<a href='http://www.zymic.com'>Zymic</a>.
Contact form hosted on
<a href='http://www.emailmeform.com'>Email Me Form</a>.
<a href='http://www.freedomain.co.nr/cheap_web_hosting.php' id='nr' target='_blank'>
<img alt='Cheap Web Hosting Providers' border='0' height='31' src='http://ruarmza.4u.com.ru/ch.gif' width='88' />
</a>
</p>
</div>
</div>
<!-- .container -->
</div>
<!-- #footer -->
<script src='scripts/google-analytics.js' type='text/javascript'></script>
<script src='scripts/page-tracker.js' type='text/javascript'></script>
</body>
</html>
Any suggestions?
I'd suggest you try a PHP-specific version of HAML, like PHPHaml or pHAML. The Ruby HAML interpreter is specifically expecting Ruby code, and will likely screw up your PHP syntax.
Having said that, I have used Chaml with some degree of success. HAML for PHP is at a rather experimental stage, and you will come across bugs. If you're writing more HTML than PHP though, it can be a great help.