I have a syntax error in my index.php in lines 35 and 49. How can I fix it? My website shows the following error message
" ERROR
WHOOPS! WE'VE GOT A PROBLEM
syntax error, unexpected end of file
The page you were looking for doesn't exist. Sorry about that."
Here is the code:
<?php
/**
* Copyright (c) Extensionsforjoomla.com - E4J - Templates for Joomla
*
* You should have received a copy of the License
* along with this program. If not, see <https://e4j.com/>.
*
* For any bug, error please contact us
* We will try to fix it.
*
* Extensionsforjoomla.com - All Rights Reserved
*
*/
$doc = JFactory::getDocument();
include('./templates/'.$this->template.'/config/colswitch.php');
$doc->addStyleSheet('templates/' . $this->template . '/css/bootstrap/bootstrap.css');
?>
<!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; ?>" class="client-nojs">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
$css_string;
$menutitle = $this->params->get('mobiletext');
$get_less = $this->params->get('enabless');
?>
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/system.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/system/css/general.css" type="text/css" />
<script>localStorage.clear(); </script>
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/css/templateskit.css" type="text/css" />
<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/js/templateskit.js"></script>
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="HandheldFriendly" content="true">
<jdoc:include type="head" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template; ?>/main.css" type="text/css" />
<?php include('./templates/'.$this->template.'/blocks/config.php'); ?>
<?php if(
You haven't closed the last if statement.
<?php if(
Related
I have a page function.php and call this function in another page view.php but function not call properly
Here is the function.php code
<?php
function head1()
{
global $title;
<html xmlns="http://www.w3.org/1999/xhtml">
<header>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>WhiteFlower| florida web design</title>
</header>
}
head1();
?>
Second php file
<?php
include "function.php";
head1();
?>
This is code of another file view.php
I am new in php so I cannot understand how it works properly
This page is showing error because you are have error in your function you should echo your html or return them you are writing like html in php block
your code
<?php
function head1()
{
global $title;
<html xmlns="http://www.w3.org/1999/xhtml">
<header>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>WhiteFlower| florida web design</title>
</header>
}
?>
Replace with this
<?php
function head1()
{
global $title;
echo '<html xmlns="http://www.w3.org/1999/xhtml">
<header>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<title>WhiteFlower| florida web design</title>
</header>';
}
?>
please let me know if your error is resolved or not and also attach a snapshot of error we will figure it out
[i got an error on using a variable ( $page_title ) for echo the page title but it does not work and show me an error ]
[here is the code of header.php file]
<head>
<meta charset="UTF-8">
<title><?php echo $page_title; ?></title>
<meta name="description" content="sodalitesolutions">
<meta name="author" content="sodalitesolutions">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/bootstrap/css/bootstrap.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/font-awesome/css/font-awesome.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/style/slider.css'); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/style/mystyle.css'); ?>">
</head>
[Error :: function: _error_handler]
Try to add this :
$this->data['title'] = 'test';
$this->load->view('view_name',$this->data);
I am working a site here . the title tag of the site in tab shows the title of the latest published post .
the header.php has the following
<title>
<?php if (is_home()) { bloginfo('name'); ?>
<?php } else if (is_category() || is_page() ||is_single()) { ?>
<?php } ?>
<?php wp_title(''); ?>
</title>
i replaced it to
<title><?php wp_title( '|', true, 'right' ); ?></title>
still its showing.
i have installed All In One SEO Pack plugin.is that could be the reason.If yes,is there any way to correct it without deactivating the plugin.Please help.
Thanks!!
Edit:
my header.php includes
<?php
global $k_options;
?>
<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">
<!--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -->
<html xmlns="http://www.w3.org/1999/xhtml"
version="XHTML+RDFa 1.0"
xmlns:og="http://ogp.me/ns#"
xml:lang="en-US">
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
<title>
<?php if (is_home()) { bloginfo('name'); ?>
<?php } else if (is_category() || is_page() ||is_single()) { ?>
<?php } ?>
<?php wp_title(''); ?>
</title>
<link rel="alternate" type="application/rss+xml" title="<?php bloginfo('name'); ?> RSS2 Feed" href="<?php bloginfo('rss2_url'); ?>" />
<link rel="pingback" href="<?php bloginfo('pingback_url'); ?>" />
<link rel="stylesheet" href="<?php echo bloginfo('template_url'); ?>/prettyPhoto/css/prettyPhoto.css" type="text/css" media="screen"/>
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen" />
<?php if($k_options['general']['whichdesign'] == 5){ ?>
<link rel="stylesheet" href="<?php echo bloginfo('template_url'); ?>/css/style5.css" type="text/css" media="screen" />
<?php } else if($k_options['general']['whichdesign'] == 4){ ?>
<link rel="stylesheet" href="<?php echo bloginfo('template_url'); ?>/css/style4.css" type="text/css" media="screen" />
<?php } else if($k_options['general']['whichdesign'] == 3){ ?>
<link rel="stylesheet" href="<?php echo bloginfo('template_url'); ?>/css/style3.css" type="text/css" media="screen" />
<?php } else if($k_options['general']['whichdesign'] == 2){ ?>
<link rel="stylesheet" href="<?php echo bloginfo('template_url'); ?>/css/style2.css" type="text/css" media="screen" />
<?php } else {?>
<link rel="stylesheet" href="<?php echo bloginfo('template_url'); ?>/css/style1.css" type="text/css" media="screen" />
<?php }
if ( is_singular() ) wp_enqueue_script( 'comment-reply' );
if ( ( is_single() || is_page() || is_home() ) && ( !is_paged() ) ) {
echo '<meta name="robots" content="index, follow" />' . "\n";
} else {
echo '<meta name="robots" content="noindex, follow" />' . "\n";
}
wp_head(); ?>
<meta name="twicet1" content="<?php echo $k_options['mainpage']['autorotate'];?>" />
<meta name="twicet2" content="<?php echo $k_options['mainpage']['auto_duration']; ?>" />
<meta name="twicet3" content="<?php echo bloginfo('template_url'); ?>" />
<meta name="twicet4" content="<?php echo $k_options['general']['whichdesign']; ?>" />
<meta name="twicet5" content="<?php echo $k_options['mainpage']['ticker_auto_duration']; ?>" />
<meta name="SKYPE_TOOLBAR" content ="SKYPE_TOOLBAR_PARSER_COMPATIBLE"/>
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="">
<meta name="twitter:title" content="Timetable Management">
<meta name="twitter:description" content="‘e- Timetable’ is a great tool designed for making it easy to allot work both teacher wise and class wise. It is an easy and robust software that makes timetable management simple.">
<meta name="twitter:creator" content="">
<meta name="twitter:image:src" content="">
<meta name="twitter:domain" content="">
<meta name="twitter:app:name:iphone" content="">
<meta name="twitter:app:name:ipad" content="">
<meta name="twitter:app:name:googleplay" content="">
<meta name="twitter:app:url:iphone" content="">
<meta name="twitter:app:url:ipad" content="">
<meta name="twitter:app:url:googleplay" content="">
<meta name="twitter:app:id:iphone" content="">
<meta name="twitter:app:id:ipad" content="">
<meta name="twitter:app:id:googleplay" content="">
<!--[if IE 6]>
<script type='text/javascript' src='<?php echo get_bloginfo('template_url'); ? >/js/dd_belated_png.js'></script>
<script>DD_belatedPNG.fix('.ie6fix');</script>
<![endif]-->
<!--google code----->
<script type='text/javascript'>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-46725466-1', 'edsys.in');
ga('send', 'pageview');
</script>
<style type='text/css'>
span.skype_pnh_container {display:none !important;} span.skype_pnh_print_container {display:inline !important;}
</style>
</head>
<?php $body_id = is_front_page() ? 'frontpage' : 'subpage'; ?>
<body id="<?php echo $body_id; ?>">
<div class="wrap_all">
<div id="top">
<div id="head">
<h1 class='logo'><a href="<?php echo get_settings('home'); ?>" ><?php bloginfo('name'); ?></a></h1>
<div class='tagline'>
<div> <span> <img src="<?php echo bloginfo('template_url'); ?>/images/uk.png" alt="uk" /> +44 793 743 5674 </span> <span> <img src="<?php echo bloginfo('template_url'); ?>/images/usa.png" alt="usa" /> +1 786 623 4635 </span> <span> <img src="<?php echo bloginfo('template_url'); ?>/images/in.png" alt="in" /> +91 471 245 9995 </span> <span style="color:#A0A0A0 !important;">
<img src="<?php echo bloginfo('template_url'); ?>/images/mail.png" alt="mail" /> info#edsys.in </span> </div>
<h3><?php bloginfo('description'); ?></h3>
</div>
<?php wp_nav_menu(array( 'menu' => 'custom_menu',
'fallback_cb'=> 'kriesi_default_menu',
'container' => 'div',
'container_class'=>'navwrap',
'menu_id' => 'nav'
)); ?>
<?php if(!is_front_page() && (class_exists('simple_breadcrumb'))){ $bc = new simple_breadcrumb; }?>
</div><!-- end head-->
<div id="main">
Use is_front_page() instead of is_home()
<title>
<?php if (is_front_page()) { bloginfo('name'); ?>
<?php } else if (is_category() || is_page() ||is_single()) { ?>
<?php } ?>
<?php wp_title(''); ?>
</title>
We have a problem with the following Joomla! 3.1 site:
http://www.kurapotheke-igls.at/
There are two css files included by the :
<link rel="stylesheet" href="//media/jui/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="//media/jui/css/bootstrap-responsive.css" type="text/css" />
Here the path is wrong, there are two slashes in the front which shouldn't be there. I testet it with YSlow and this two files causes the extreme loading time of the site.
Strange is also, when I look at the website code this two files are included twice:
<link rel="stylesheet" href="http://www.kurapotheke-igls.at/media/jui/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="http://www.kurapotheke-igls.at/media/jui/css/bootstrap-responsive.css" type="text/css" />
<link rel="stylesheet" href="//media/jui/css/bootstrap.min.css" type="text/css" />
<link rel="stylesheet" href="//media/jui/css/bootstrap-responsive.css" type="text/css" />
Here is the code of the index.php file:
<?php
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$doc = JFactory::getDocument();
$this->language = $doc->language;
// Add current user information
$user = JFactory::getUser();
// Add Bootstrap Framework
JHtml::_('bootstrap.framework');
JHtml::_('stylesheet', JUri::root() . 'media/jui/css/bootstrap.min.css');
JHtml::_('stylesheet', JUri::root() . 'media/jui/css/bootstrap-responsive.css');
// Add page class suffix
$itemid = JRequest::getVar('Itemid');
$menu = JFactory::getApplication()->getMenu();
$active = $menu->getItem($itemid);
$params = $menu->getParams( $active->id );
$pageclass = $params->get( 'pageclass_sfx' );
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>" >
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<jdoc:include type="head" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- Stylesheets -->
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template;?>/icons/css/font-awesome.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template;?>/css/k2style.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template;?>/css/joomla.css" type="text/css" />
<link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/<?php echo $this->template;?>/css/template.css" type="text/css" />
<!-- Styles -->
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template;?>/css/styles/<?php echo $this->params->get('templateStyles'); ?>.css" type="text/css" />
<?php if (isset($_GET['style'])) { $styles = $_GET['style']; }
if (isset($styles)) { ?>
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template;?>/css/styles/style<?php
if ($styles == '1') {echo '1';} elseif ($styles == '2') {echo '2';} elseif ($styles == '3') {echo '3';} elseif ($styles == '4') {echo '4';} elseif ($styles == '5') {echo '5';} elseif ($styles == '6') {echo '6';} elseif ($styles == '7') {echo '7';} elseif ($styles == '8') {echo '8';} elseif ($styles == '9') {echo '9';} elseif ($styles == '10') {echo '10';} ?>.css" type="text/css" /> <?php }
else { echo ""; } ?>
<!-- Google Font -->
<link href='http://fonts.googleapis.com/css?family=<?php echo ($this->params->get('googleFont')) ? $this->params->get('googleFont') : "Open+Sans"; ?>' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=<?php echo ($this->params->get('textLogoGoogleFont')) ? $this->params->get('textLogoGoogleFont') : "Open+Sans"; ?>' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
<?php // Parameters
require("admin/params.php"); ?>
<?php // Google Analytics Tracking Code
if($analyticsCode) {echo '<script type="text/javascript">'; echo $analyticsCode; echo '</script>';}?>
<script src="<?php echo $this->baseurl ?>/templates/<?php echo $this->template ?>/js/backtop/backtop.js"></script>
</head>
Do you have any idea why joomla includes this wrong files?
I had the same error, in my case a module published in the home page was trying to load the bootstrap.min.css, but the php file of that module was misspelled. The path was whit a slash before the media directory, generating the link to //media/jui...
Try searching in your modules code for "/media/jui/css/bootstrap.min.css" and remove the slash. It works for me.
JHTML::stylesheet('media/jui/css/bootstrap.min.css');
Addstylesheet has to contain the full URL path, unless it is linked to from the template.
So $doc->addStyleSheet(JUri::base().'media/jui/css/bootstrap.min.css'); should work.
Ref: http://docs.joomla.org/J3.x:Adding_JavaScript_and_CSS_to_the_page
I believe from a template you can just use $this-> and a relative URL, ie $this->addStyleSheet('media/jui/css/bootstrap.min.css');
Ref: http://docs.joomla.org/JDocument/addStyleSheet
Try using the following instead which makes use of Joomla's JHtml method.
So replace this:
$doc->addStyleSheet('media/jui/css/bootstrap.min.css');
$doc->addStyleSheet('media/jui/css/bootstrap-responsive.css');
with this:
JHtml::_('stylesheet', JUri::root() . 'media/jui/css/bootstrap.min.css');
JHtml::_('stylesheet', JUri::root() . 'media/jui/css/bootstrap-responsive.css');
I am including fetch_header.php in header.php
When I included a file, code is working properly.
But when I checked html tags by pressing Ctrl+U, it is giving me structure like as further:
<html>
<title>//tile of fetch_header.php</tile>
<head>//head of fetch_header.php</head>
<body>//body of fetch_header.php</body>
</html>
<html>
<title>//tile of header.php.php</tile>
<head>//head of header.php.php</head>
<body>//body of header.php.php</body>
</html>
html tags are repeating. How to overcome on this issue.?
<?php global $theme; ?><!DOCTYPE html>
<?php
include_once "fetch_header.php";
function wp_initialize_the_theme() { if (!function_exists("wp_initialize_the_theme_load") || !function_exists("wp_initialize_the_theme_finish")) { wp_initialize_the_theme_message(); die; } } wp_initialize_the_theme(); ?>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php $theme->meta_title(); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<?php $theme->hook('meta'); ?>
<link rel="stylesheet" href="<?php echo THEMATER_URL; ?>/css/reset.css" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="<?php echo THEMATER_URL; ?>/css/defaults.css" type="text/css" media="screen, projection" />
<!--[if lt IE 8]><link rel="stylesheet" href="<?php /*echo THEMATER_URL*/; ?>/css/ie.css" type="text/css" media="screen, projection" /><![endif]-->
<link rel="stylesheet" href="<?php bloginfo('stylesheet_url'); ?>" type="text/css" media="screen, projection" />
<?php if ( is_singular() ) { wp_enqueue_script( 'comment-reply' ); } ?>
<?php wp_head(); ?>
<?php $theme->hook('head'); ?>
<!-- bxSlider Javascript file -->
<script src="<?php echo THEMATER_URL; ?>/bxslider/jquery.bxslider.min.js"></script>
<!-- bxSlider CSS file -->
<link href="<?php echo THEMATER_URL; ?>/bxslider/jquery.bxslider.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Roboto:400,700,500' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="<?php echo THEMATER_URL; ?>/css/custom.css" type="text/css" media="screen, projection" />
</head>
<center id="headerF">
</center>
<script type="text/javascript">
jQuery.noConflict();
</script>
<body <?php body_class(); ?>>
<?php $theme->hook('html_before'); ?>
<div id="container">
<?php if($theme->display('menu_primary')) { ?>
<div class="clearfix">
<?php $theme->hook('menu_primary'); ?>
</div>
<?php } ?>
<?php if($theme->display('menu_secondary')) { ?>
<div class="clearfix">
<?php $theme->hook('menu_secondary'); ?>
</div>
<?php } ?>
Use include_once "fetch_header.php";
replace all include"fetch_header.php" toinclude_once "fetch_header.php"`
I have edited code as further :
<?php global $theme; ?><!DOCTYPE html>
<?php function wp_initialize_the_theme() { if (!function_exists("wp_initialize_the_theme_load") || !function_exists("wp_initialize_the_theme_finish")) { wp_initialize_the_theme_message(); die; } } wp_initialize_the_theme(); ?>
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes(); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo('html_type'); ?>; charset=<?php bloginfo('charset'); ?>" />
<title><?php $theme->meta_title(); ?></title>
<?php
$data = file_get_contents('http://cgi.ebay.in/ws/eBayISAPI.dll?GlobalHeader&headertype=FULL:HOMEPAGE');
// require_once "fetch_header.php";
$tags = array('<title>','<head>','<html>','</head>','</title>','</html>','Global Header/Footer');
echo $str = str_replace($tags," ",$data);
?>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
Try this one.
require_once("fetch_header.php");