Wordpress Remove a button from header if on that page - php

I need help trying to figure out how to get a button removed if a user is on the profile page, or if they are on the page, the button could display as a current menu item only it is not clickable.
Here is my code:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo('charset'); ?>">
<meta name="viewport" content="width=device-width, initial-scale=1">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<header class="site-header">
<div class="container">
<h1 class="school-logo-text float-left"><strong>Direct</strong> Connection</h1>
<?php if(is_user_logged_in()) {
?>
<i class="fa fa-search" aria-hidden="true"></i>
<i class="site-header__menu-trigger fa fa-bars" aria-hidden="true"></i>
<div class="site-header__menu group">
<nav class="main-navigation">
<ul>
<li <?php if (get_post_type() == 'event' OR is_page('past-events')) echo 'class="current-menu-item"';
?>>Events</li>
<li <?php if (get_post_type() == 'post') echo "class='current-menu-item'"
?>>Blogs</li>
</ul>
</nav>
<?php } ?>
<div class="site-header__util">
<?php if(is_user_logged_in()) { ?>
<a href="<?php if (is_page() == 'profile') //Needs a function here ?>" class="btn
btn--small btn--dark-orange float-left push-right">View Profile</a>
<a href="<?php echo wp_logout_url(); ?>" class="btn
btn--small btn--orange float-left push-right btn--with-photo">
<span class="site-header__avatar"><?php
echo get_avatar(get_current_user_id(), 60); ?></span>
<span class="btn__text">Log Out</span>
</a>
<?php } else{ ?>
Login
<?php }?>
<?php if(is_user_logged_in()) {
?>
<span href="<?php echo esc_url(site_url('/search')); ?>" class="search-trigger js-search-trigger"><i class="fa fa-search" aria-hidden="true"></i></span>
<?php } ?>
</div>
</div>
</div>
</header>

To hide the button when on a specific page you can add the following code to your functions.php file.
function hide_button_on_page_4() {
if ( is_page ( 4 ) ) {
echo '<style>
.btn.btn--small.btn--dark-orange.float-left.push-right {
display: none;
}
</style>';
}
}
add_action( 'wp_head', 'hide_button_on_page_4' );
In the code above I hide the button when on the page that has 4 as its ID. You can modify is_page(4) with your corresponding page ID.
You can find the page ID in the URL of the page when you are in the editor. For example, if the URL of the page is http://website.com/wp-admin/post.php?post=123&action=edit, the page ID is 123.

Related

how do i resolve WordPress website white screen

Today i tried to upload my local website created on XAMPP to the live server but after uploading and configuration of the DB, I'm facing a white screen issue, after some research i released that the problem on my theme when i activated the debugger (define( 'WP_DEBUG', true );) im recieving this msg :
Fatal error: Call to undefined function appcloud_option() in /home/groupe/public_html/wp-content/themes/appcloud/header.php on line 27
the problem is on my localhost everything seems to be fine.
<?php
?><!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">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<div id="page" class="site">
<!--preloder start here-->
<?php
if( appcloud_option('appcloud_display_preloader') == '1' && appcloud_option('appcloud_display_preloader') != '' ) {
$preloader_image = appcloud_option('appcloud_preloader_image_up');
$preloader_image = $preloader_image['url'];
?>
<div id="preloader" <?php if( $preloader_image != '' ){ ?>style="background-image: url( <?php echo esc_url($preloader_image); ?> );"<?php } ?>></div>
<?php } ?>
<!--preloder end here-->
<header id="masthead" class="site-header">
<div class="<?php if( appcloud_option('appcloud_sticky_menu_active') == '1'){ echo esc_attr('heading_nav'); } else{ echo esc_attr('general_heading_nav'); } ?>">
<div class="container-fluid">
<div class="<?php if( appcloud_option('appcloud_sticky_menu_active') == '1'){ echo esc_attr('nav-bg navbar-fixed-top'); } else{ echo esc_attr('navbr-bg'); } ?>" >
<div class="row">
<div class="col-lg-12">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
<span class="sr-only"><?php esc_html_e('Toggle navigation', 'appcloud'); ?></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<?php if( function_exists('appcloud_logo')){ appcloud_logo(); } ?>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<?php if( function_exists('appcloud_main_menu')){ appcloud_main_menu(); } ?>
</div><!-- /.navbar-collapse -->
</div>
</div>
</div>
</div>
</div>
</header><!-- #masthead -->
hey i just fixed the problem it appears the i had some kind of issue in my theme folder i uploaded the child theme again and made my modifications and everything is alright now.
thx for your help guys.

Loop is inside footer somehow. Wordpress theme development

I have a 1px border assigned to my footer on my wordpress theme, which worked well, but somewhere along the line, that border appeared at the top of my loop. I'm not sure if I have a missing end div somewhere, or what I did, but it's driving me nuts!
Here is my header.php file.
<DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo(charset); ?>">
<meta name="viewport" content="width=device-width">
<title><?php bloginfo('name'); ?></title>
<link href="https://fonts.googleapis.com/css?family=Abel|Dosis|Exo|Galada|Muli|Old+Standard+TT|Open+Sans+Condensed:300|Rajdhani|Raleway|Shrikhand|Bad+Script|Cinzel+Decorative|Allan" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<?php wp_head(); ?>
</head>
<body <?php body_class(); ?>>
<!-- Site Header -->
<header class="site-header">
<div class="dropdown">
<button onclick="myFunction()" class="dropbtn"><i class="fa fa-cog"></i></button>
<div id="myDropdown" class="dropdown-content">
<?php wp_nav_menu (array('theme_location' => 'primary')); ?>
</div>
</div>
<script>
/* When the user clicks on the button,
toggle between hiding and showing the dropdown content */
function myFunction() {
document.getElementById("myDropdown").classList.toggle("show");
}
// Close the dropdown if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.matches('.dropbtn')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
var i;
for (i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
</script>
</header>
<!-- /Site Header -->
Here is my index.php file, which contains the loop.
<div class="homepage-banner">
<div class="homepage-banner__bg-image" style="background-image: url(<?php echo get_theme_file_uri('/images/header3.png') ?>);">
</div>
<div class="homepage-banner__content">
<div class="headline-large">acetronaut</div>
<div class="headline-mid">fashion. beauty. lifestyle. adventure</div>
</div>
<div class="arrow"><i class="fa fa-angle-double-down"></i>
</div>
</div>
<?php get_header(); ?>
<div id="content">
<?php if (have_posts()) :
while (have_posts()) : the_post(); ?>
<div class="acetronaut-half">
<div class="acetronaut-post" style="background-image:url(<?php echo wp_get_attachment_url( get_post_thumbnail_id( $post->ID ) ); ?>);">
<div class="acetronaut-post-content">
<h2 class="acetrnt-post-category"><?php the_category(); ?></h2>
<h2 class="blog-title"><?php the_title(); ?></h2>
<p><?php echo get_the_excerpt(''); ?><a href="<?php the_permalink(); ?>">Continue Reading »</p>
</div>
</div>
</div>
<?php endwhile;
else :
echo '<p>No content Found</p>';
endif;
get_footer();
?>
</div>
And here is my footer.php file.
<footer class="site-footer">
<?php
$args = array('theme_location' => 'footer')
?>
<nav class="site-nav"><?php wp_nav_menu( $args ); ?></nav>
<p><?php bloginfo('name'); ?> >> © <?php echo date('Y'); ?></p>
</footer>
<?php wp_footer(); ?>
</body>
</html>
If anyone can find where the problem might be, I would greatly appreciate it.

HTML inside PHP file not loading external CSS file

I haven't coded for a long time and my skills are basic.
I got a php file. It's a section file from a wordpress theme i am customizing.
My problem is. Made the code to link to an external css file to customize the social media icons, but it's not loading the CSS!
Here's the code:
<!DOCTYPE html>
<html lang = "en-US">
<head>
<meta charset = "UTF-8">
<link rel="stylesheet" type="text/css" href="D:\xampp\htdocs\alfasteel.pt\wp-content\themes\onetone\css\socialmedia.css" />
</head>
<body>
<div class="footer-social-icons">
<h4 class="_14">Follow us on</h4>
<ul class="social-icons">
<li> <i class="fa fa-facebook"></i></li>
<li> <i class="fa fa-twitter"></i></li>
<li> <i class="fa fa-rss"></i></li>
<li> <i class="fa fa-youtube"></i></li>
<li> <i class="fa fa-linkedin"></i></li>
<li> <i class="fa fa-google-plus"></i></li>
</ul>
</div>
Here's the whole file code in case you need it:
<!DOCTYPE html>
<html lang = "en-US">
<head>
<meta charset = "UTF-8">
<link rel="stylesheet" type="text/css" href="D:\xampp\htdocs\alfasteel.pt\wp-content\themes\onetone\css\socialmedia.css" />
</head>
<body>
<?php
global $onetone_animated, $onetone_section_id, $allowedposttags;
$i = $onetone_section_id ;
$section_title = onetone_option( 'section_title_'.$i );
$section_menu = onetone_option( 'menu_title_'.$i );
$section_content = onetone_option( 'section_content_'.$i );
$content_model = onetone_option( 'section_content_model_'.$i);
$section_subtitle = onetone_option( 'section_subtitle_'.$i );
$left_content = onetone_option( 'section_left_content_'.$i );
$right_content = onetone_option( 'section_right_content_'.$i );
if( !isset($section_content) || $section_content=="" )
$section_content = onetone_option( 'sction_content_'.$i );
if( $content_model == '0' || $content_model == '' ):
?>
<?php if( $section_title != '' || (function_exists('is_customize_preview') && is_customize_preview()) ):?>
<?php
$section_title_class = '';
if( $section_subtitle == '' && !(function_exists('is_customize_preview') && is_customize_preview()))
$section_title_class = 'no-subtitle';
?>
<h2 class="section-title <?php echo esc_attr($section_title_class); ?> <?php echo 'section_title_'.$i;?>"><?php echo wp_kses($section_title, $allowedposttags);?></h2>
<?php endif;?>
<?php if( $section_subtitle != '' || (function_exists('is_customize_preview') && is_customize_preview()) ):?>
<div class="section-subtitle <?php echo 'section_subtitle_'.$i;?>"><?php echo do_shortcode(wp_kses($section_subtitle, $allowedposttags));?></div>
<?php endif;?>
<div class="home-section-content">
<div class="footer-social-icons">
<h4 class="_14">Follow us on</h4>
<ul class="social-icons">
<li> <i class="fa fa-facebook"></i></li>
<li> <i class="fa fa-twitter"></i></li>
<li> <i class="fa fa-rss"></i></li>
<li> <i class="fa fa-youtube"></i></li>
<li> <i class="fa fa-linkedin"></i></li>
<li> <i class="fa fa-google-plus"></i></li>
</ul>
</div>
<div class="row">
<div class="col-md-8"><div class="<?php echo $onetone_animated;?> <?php echo 'section_left_content_'.$i;?>" data-animationduration="0.9" data-animationtype="fadeInLeft" data-imageanimation="no"><?php echo do_shortcode($left_content);?></div></div>
<div class="col-md-4"><div class="<?php echo $onetone_animated;?> <?php echo 'section_right_content_'.$i;?>" data-animationduration="0.9" data-animationtype="fadeInRight" data-imageanimation="no"><?php echo do_shortcode($right_content);?></div></div>
</div>
</div>
<?php
else:
?>
<?php if( $section_title != '' || (function_exists('is_customize_preview') && is_customize_preview()) ):?>
<div class="section-title <?php echo 'section_title_'.$i;?>"><?php echo esc_attr($section_title);?></div>
<?php endif;?>
<div class="home-section-content <?php echo 'section_content_'.$i;?>">
<?php
if(function_exists('Form_maker_fornt_end_main'))
{
$section_content = Form_maker_fornt_end_main($section_content);
}
echo do_shortcode(wp_kses($section_content, $allowedposttags));
?>
</div>
<?php
endif;
?>
</body>
</html>
Your files sit under the web server htdocs folder. You can access them over HTTP by specifying their URI.
change href="D:\xampp\htdocs\alfasteel.pt\wp-content\themes\onetone\css\socialmedia.php"
to
href="http://localhost/alfasteel.pt/wp-content/themes/onetone/css/socialmedia.php"
As #Itay Moav -Malimovka suggested
It was the path that wasn't the right way!
This works!
<link rel="stylesheet" type="text/css" href="http://localhost/alfasteel.pt/wp-content/themes/onetone/css/socialmedia.css" />
Thanks a lot for your help guys!

Trying to make link with user id in joomla

I'm trying to add button with link to a seller store in my joomla component and I have no idea how can I do it.
I'm adding code from php file that has what I need but I don't know how to add it on another page. If someone can guide me with some how to step it would be awesome.
Here is the page that has the link to the store:
<?php
// no direct access
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
/** #var SellaciousViewProduct $this */
$sellers = $this->item->get('sellers');
if (!isset($sellers[0]) || (count($sellers) == 1 && $sellers[0]->seller_uid == $this->item->get('seller_uid')))
{
return;
}
$c_currency = $this->helper->currency->current('code_3');
?>
<div class="clearfix"></div>
<a name="also-selling"> </a>
<hr class="isolate"/>
<h4 class="center"><?php echo JText::_('COM_SELLACIOUS_PRODUCT_HEADING_BLOCK_SELLERS'); ?></h4>
<table class="product-sellers table table-striped table-hover table-bordered">
<thead>
<tr>
<th>SELLER </th>
<th>DELIVERY INFO</th>
<th>PRICE </th>
<th>ACTION </th>
</tr>
</thead>
<tbody>
<?php
foreach ($sellers as $i => $seller)
{
/** #var Registry $item */
$item = new Registry($seller);
$s_currency = $this->helper->currency->forSeller($item->get('seller_uid'), 'code_3');
// todo: Add this to config (show current one or not in more sellers) and move to model
if ($item->get('seller_uid') == $this->item->get('seller_uid'))
{
continue;
}
?>
<tr>
<td style="width: 220px;" class="nowrap">
<div class="seller-info">
<a href="<?php echo JRoute::_('index.php?option=com_sellacious&view=store&id=' . $item->get('seller_uid')); ?>">
<?php echo $item->get('seller_company', $item->get('seller_name')); ?></a>
<?php $rating = $item->get('seller_rating.rating'); ?>
<span class="label <?php echo ($rating < 3) ? 'label-warning' : 'label-success' ?>"><?php echo number_format($rating, 1) ?> / 5.0</span>
</div>
<?php if ($item->get('exchange_days')): ?>
<?php if ($item->get('exchange_tnc')):
$options = array(
'title' => '<strong>' . (int) $item->get('exchange_days') . ' Days</strong> Replacement Guarantee',
'backdrop' => 'static',
);
echo JHtml::_('bootstrap.renderModal', 'exchange_tnc-' . $item->get('code'), $options, $item->get('exchange_tnc'));
endif; ?>
<div class="replacement-info">
<i class="fa fa-refresh"></i>
<strong> <?php echo (int) $item->get('exchange_days') ?> Days</strong> Replacement
<?php if ($item->get('exchange_tnc')): ?>
[<i class="fa fa-question"></i>]
<?php endif; ?>
</div>
<?php endif; ?>
<?php if ($item->get('return_days')): ?>
<?php if ($item->get('return_tnc')):
$options = array(
'title' => '<strong>' . (int) $item->get('return_days') . ' Days</strong> Easy Return',
'backdrop' => 'static',
);
echo JHtml::_('bootstrap.renderModal', 'return_tnc-' . $item->get('code'), $options, $item->get('return_tnc'));
endif; ?>
<div class="replacement-info">
<i class="fa fa-refresh"></i>
<strong> <?php echo (int) $item->get('return_days') ?> Days</strong> Easy Return
<?php if ($item->get('return_tnc')): ?>
[<i class="fa fa-question"></i>]
<?php endif; ?>
</div>
<?php endif; ?>
<div>
<?php $allowed_listing_type = (array) $this->helper->config->get('allowed_listing_type'); ?>
<?php if (count($allowed_listing_type) != 1): ?>
<span class="label label-info margin-top-10">Condition:
<?php
$list_type = $item->get('listing_type');
// What if this is a not allowed listing type value
if ($list_type == 1):
echo JText::plural('COM_SELLACIOUS_PRODUCT_FIELD_LISTING_TYPE_VALUE', $list_type);
else:
$list_cond = $item->get('item_condition');
echo JText::plural('COM_SELLACIOUS_PRODUCT_FIELD_ITEM_CONDITION_VALUE', $list_type * 10 + (int) $list_cond);
endif;
?>
</span>
<?php endif; ?>
</div>
</td>
<td>
<div class="delivery-info">
<?php echo JHtml::_('date', '+ ' . rand(1, 30) . ' days', 'D, dS F'); ?>
<br>
<small><?php
$flat_ship = $item->get('flat_shipping');
$ship_fee = $item->get('shipping_flat_fee');
if ($flat_ship == 0)
{
echo JText::_('COM_SELLACIOUS_PRODUCT_SHIPPING_FEE_IN_CART');
}
elseif (round($ship_fee, 2) > 0)
{
$fee = $this->helper->currency->display($ship_fee, $s_currency, $c_currency, true);
echo JText::sprintf('COM_SELLACIOUS_PRODUCT_SHIPPING_FEE_FLAT', $fee);
}
else
{
echo JText::_('COM_SELLACIOUS_PRODUCT_SHIPPING_FEE_FREE');
}
?></small>
</div>
</td>
<td style="width:90px;" class="center">
<span class="product-price-sm"><?php
echo $this->helper->currency->display($item->get('price.sales_price'), $s_currency, $c_currency, true) ?></span>
</td>
<td style="width:100px;" class="nowrap">
<?php $link = JRoute::_('index.php?option=com_sellacious&view=product&p=' . $item->get('code')); ?>
<button class="btn btn-primary btn-cart-sm">DETAILS</button><br/>
<button type="button" class="btn btn-warning btn-cart-sm btn-add-cart" data-item="<?php echo $item->get('code') ?>">ДОБАВИ В КОЛИЧКАТА</button>
<!--<button type="button" class="btn btn-success btn-cart-sm btn-add-cart"
data-item="<?php /*echo $item->get('code') */?>" data-checkout="true">КУПИ СЕГА</button>-->
</td>
</tr>
<?php
}
?>
</tbody>
</table>
And this is the file I'm trying to import the part with the link to the sellers store
<?php
// no direct access.
defined('_JEXEC') or die;
jimport('sellacious.loader');
if (class_exists('SellaciousHelper'))
{
$helper = SellaciousHelper::getInstance();
}
?>
<!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; ?>">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<!-- favicon -->
<link rel="shortcut icon" href="templates/sellacious/images/favicon/favicon.ico" type="image/x-icon" />
<link rel="icon" href="templates/sellacious/images/favicon/favicon.ico" type="image/x-icon" />
<?php
$user = JFactory::getUser();
$doc = JFactory::getDocument();
$app = JFactory::getApplication();
$sitename = $app->get('sitename');
JHtml::_('script', 'media/com_sellacious/js/plugin/messagebox/jquery.messagebox.min.js', false, false);
JHtml::_('stylesheet', 'media/com_sellacious/js/plugin/messagebox/jquery.messagebox.css', null, false);
$doc->addStyleSheet('//fonts.googleapis.com/css?family=Open+Sans:400italic,700italic,300,400,700');
$doc->addStyleSheet('templates/sellacious/css/bootstrap.min.css', 'text/css', 'screen');
$doc->addStyleSheet('templates/sellacious/css/font-awesome.min.css', 'text/css', 'screen');
$doc->addStyleSheet('templates/sellacious/css/joomla-icons.css', 'text/css', 'screen');
$doc->addStyleSheet('templates/sellacious/css/smartadmin-production.css', 'text/css', 'screen');
$doc->addStyleSheet('templates/sellacious/css/smartadmin-skins.css', 'text/css', 'screen');
$doc->addStyleSheet('templates/sellacious/css/custom-style.css', 'text/css', 'screen');
if ($this->direction == 'rtl')
{
$doc->addStyleSheet('templates/sellacious/css/smartadmin-rtl.css', 'text/css', 'screen');
}
JHtml::_('jquery.framework');
JHtml::_('bootstrap.tooltip');
$doc->addScript('templates/sellacious/js/libs/jquery-ui-1.10.3.min.js'); // jQuery UI full, not from joomla core's minimised one
$doc->addScript('templates/sellacious/js/plugin/fastclick/fastclick.js'); // FastClick: For mobile devices
$doc->addScript('templates/sellacious/js/plugin/jquery-touch/jquery.ui.touch-punch.min.js'); // JS TOUCH plugin for mobile drag-drop touch events
$doc->addScript('templates/sellacious/js/plugin/msie-fix/jquery.mb.browser.min.js'); // browser msie issue fix
$doc->addScript('templates/sellacious/js/bootstrap/bootstrap.min.js'); // Bootstrap JS
$doc->addScript('templates/sellacious/js/notification/SmartNotification.min.js'); // Custom notification
$doc->addScript('templates/sellacious/js/plugin/cookie/jquery.cookie.min.js'); // cookie
$doc->addScript('templates/sellacious/js/sellacious-core.js'); // Sellacious core functions to work template wide
$doc->addScript('templates/sellacious/js/sellacious-notifier.js'); // Sellacious notification per view page
?>
<script data-pace-options='{ "restartOnRequestAfter": true }' src="templates/sellacious/js/plugin/pace/pace.min.js"></script>
<jdoc:include type="head"/>
<!--[if IE 7]>
<h1>Your browser is out of date, please update your browser by going to www.microsoft.com/download</h1>
<![endif]-->
</head>
<?php $collapse = $app->input->cookie->get('collapsedmenu'); ?>
<body class="fixed-page-footer <?php echo $app->input->get('hidemainmenu') || $collapse ? 'minified' : '' ?>"><!--
The possible classes: smart-style-3, minified, fixed-ribbon, fixed-header, fixed-width -->
<!-- HEADER -->
<header id="header" class="btn-group-justified">
<div id="logo-group">
<?php
$logo = 'templates/sellacious/images/logo.png';
if (isset($helper) && $helper->access->isSubscribed()):
$altLogo = $helper->media->getImage('config.backoffice_logo', 1, false);
$logo = $altLogo ?: $logo;
endif;
?>
<span id="logo"><a class="pull-left" href="<?php echo JRoute::_('index.php') ?>">
<img src="<?php echo $logo ?>" alt="<?php echo htmlspecialchars($sitename) ?>"></a></span>
<?php if ($this->countModules('logo-group')) { ?>
<!-- OPTIMAL PLACE FOR NOTIFICATION MODULE -->
<jdoc:include type="modules" name="logo-group" style="none"/>
<?php } ?>
</div>
<?php if ($this->countModules('header-left')) { ?>
<!-- Project Context -->
<jdoc:include type="modules" name="header-left" style="none"/>
<?php } ?>
<!-- pulled right: nav area -->
<div class="pull-right" style="margin-right: 1px;">
<!-- logout button -->
<div id="logout" class="btn-header transparent pull-right cursor-pointer">
<?php $logout_url = 'index.php?option=com_login&task=logout&' . JSession::getFormToken() . '=1'; ?>
<span> <a href="<?php echo $logout_url ?>" title="Sign Out" data-action="userLogout" class="hasTooltip" data-placement="bottom"
data-logout-msg="You can improve your security further after logging out by closing this opened browser"><i
class="fa fa-sign-out"></i></a> </span>
</div>
<!-- end logout button -->
<!-- fullscreen button -->
<div id="fullscreen" class="btn-header transparent pull-right">
<span> <a href="javascript:void(0);" data-action="launchFullscreen" class="hasTooltip" data-placement="bottom"
title="Full Screen"><i class="fa fa-arrows-alt"></i></a> </span>
</div>
<!-- end fullscreen button -->
<!-- back to Joomla administrator button -->
<div id="my-tore" class="btn-header transparent pull-right cursor-pointer">
<span> <a href="../<?php echo basename(JPATH_ADMINISTRATOR); ?>/index.php" class="hasTooltip" data-placement="bottom"
title="Back to Joomla Administrator"><i class="fa fa-joomla"></i></a> </span>
</div>
<!-- end back to Joomla administrator button -->
<!-- Go to Joomla frontend button -->
<div id="joomla" class="btn-header transparent pull-right cursor-pointer">
<span> <a href="../index.php" target="_blank" class="hasTooltip" data-placement="bottom"
title="View Site"><i class="fa fa-external-link"></i></a> </span>
</div>
<!-- end Go to Joomla frontend button -->
<!-- Go to Joomla frontend button -->
<div id="hide-menu" class="btn-header transparent pull-right cursor-pointer">
<span> <a href="#" class="hasTooltip" data-placement="bottom" data-menu="hidemenu"
title="Menu"><i class="fa fa-reorder"></i></a> </span>
</div>
<!-- end Go to Joomla frontend button -->
<!-- Sync media button -->
<div id="sync-media" class="btn-header transparent pull-right cursor-pointer">
<span> <a href="javascript:void(0)" class="hasTooltip" data-placement="bottom" data-action="sync-media" style="width: 135px;"
title="Refresh Media Uploads"><i class="fa fa-refresh"></i> <span class="text-normal"> <?php
echo JText::_('COM_SELLACIOUS_MEDIA_SYNC_BUTTON_LABEL') ?> </span></a> </span>
</div>
<!-- end Sync media button -->
<?php if ($this->countModules('header-right')): ?>
<jdoc:include type="modules" name="header-right" style="none"/>
<?php endif; ?>
</div>
<!-- end pulled right: nav area -->
<?php if (isset($helper) && ($helper->access->check('config.edit') || !$helper->access->isSubscribed())): ?>
<div id="context-news" class="pull-right padding-5"><!-- dynamic news --></div>
<?php endif; ?>
</header>
<!-- END HEADER -->
<!-- Left panel : Navigation area -->
<?php if ($this->countModules('left-panel') || $this->countModules('menu')) { ?>
<!-- Note: This width of the aside area can be adjusted through LESS variables -->
<aside id="left-panel">
<div class="login-info">
<span> <!-- User image size is adjusted inside CSS, it should stay as it -->
<a style="cursor:auto;" id="show-shortcut" data-action="toggleShortcut" href="index.php?option=com_sellacious&view=profile">
<!--<img src="templates/sellacious/images/avatars/male.png" alt="me" class="online"/>-->
<i class="fa fa-user"></i>
<span><?php echo $user->get('name'); ?></span>
</a>
</span>
</div>
<!-- User info -->
<?php if ($this->countModules('left-panel')) { ?>
<jdoc:include type="modules" name="left-panel" style="none"/>
<?php } ?>
<!-- end user info -->
<!-- NAVIGATION : This navigation is also responsive
To make this navigation dynamic please make sure to link the node
(the reference to the nav > ul) after page load. Or the navigation will not initialize.
-->
<!-- User info -->
<?php if ($this->countModules('menu')) { ?>
<jdoc:include type="modules" name="menu" style="none"/>
<?php } ?>
<!-- end user info -->
<span class="minifyme"> <i class="fa fa-arrow-circle-left hit"></i> </span>
</aside>
<!-- END NAVIGATION -->
<?php } ?>
<!-- End Left panel : Navigation area -->
<!-- MAIN PANEL -->
<div id="main" role="main">
<!-- RIBBON -->
<div id="ribbon">
<!-- breadcrumb -->
<?php if ($this->countModules('ribbon-left')) { ?>
<jdoc:include type="modules" name="ribbon-left" style="none"/>
<?php } ?>
<!-- end breadcrumb -->
<?php if ($this->countModules('ribbon-right')) { ?>
<span class="ribbon-button-alignment pull-right">
<jdoc:include type="modules" name="ribbon-right" style="none"/>
</span>
<?php } ?>
<div class="btn-headactions pull-right">
<i class="fa fa-book"></i> Documentation
<i class="fa fa-phone"></i> Support
<i class="fa fa-star"></i> Rate us on JED
</div>
</div>
<!-- END RIBBON -->
<?php if ($this->countModules('toolbar') || $this->countModules('title')) : ?>
<div class="box-toolbar">
<div class="">
<!-- col -->
<div class="pull-left">
<!-- PAGE HEADER -->
<jdoc:include type="modules" name="title"/>
</div>
<!-- end col -->
<!-- right side of the page with the sparkline graphs -->
<!-- col -->
<div class="pull-right">
<?php if ($this->countModules('toolbar')) : ?>
<span class="pull-right">
<jdoc:include type="modules" name="toolbar" style="none"/>
</span>
<?php endif; ?>
</div>
<!-- end col -->
</div>
</div>
<?php endif; ?>
<?php if ($this->countModules('top')) : ?>
<div class="row">
<div class="col-sm-12">
<jdoc:include type="modules" name="content-top" style="xhtml"/>
</div>
</div>
<?php endif; ?>
<?php if ($this->countModules('submenu')) : ?>
<div class="row">
<div class="col-sm-12">
<jdoc:include type="modules" name="submenu" style="none"/>
</div>
</div>
<?php endif; ?>
<div class="clearfix"></div>
<!-- MAIN CONTENT -->
<div id="content">
<?php if ($this->countModules('content-top')) { ?>
<div class="row">
<jdoc:include type="modules" name="content-top" style="none"/>
</div>
<?php } ?>
<div class="clearfix"></div>
<div class="component content-wrap">
<div id="system-message-container"><jdoc:include type="message" style="xhtml"/></div>
<div class="clearfix"></div>
<jdoc:include type="component" style="xhtml"/>
<div class="clearfix"></div>
</div>
<?php if ($this->countModules('content-bottom')) { ?>
<div class="row">
<jdoc:include type="modules" name="content-bottom" style="none"/>
</div>
<?php } ?>
</div>
<div class="clearfix"></div>
<!-- END MAIN CONTENT -->
</div>
<!-- END MAIN PANEL -->
<?php if ($this->countModules('footer')) { ?>
<jdoc:include type="modules" name="footer" style="none"/>
<?php } ?>
<jdoc:include type="modules" name="dynamic" style="xhtml"/>
<!-- Google Analytics code below -->
<?php if ($ga_code = $this->params->get('ga_code')) { ?>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '<?php echo htmlspecialchars($ga_code) ?>']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script');
ga.type = 'text/javascript';
ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(ga, s);
})();
</script>
<?php } ?>
</body>
</html>
I understand that I need this link,
<a href="<?php echo JRoute::_('index.php?option=com_sellacious&view=store&id=' . $item->get('seller_uid')); ?>">
<?php echo $item->get('seller_company', $item->get('seller_name')); ?></a>
but don't know how to implement it in the second file.
You need access to the view object from the sellacious product view in your file (i.e. the this in $sellers = **$this**->item->get('sellers')). Your file is a template file, and templates don't have access to the component view object - it's already been marked for garbage collection by the time the template renders. If you are only rendering the sellacious store links on pages that include the sellacious component, you could copy and store the data in JRegistry to use in the template. You could do this in a layout override from your template (layouts have access to their component's view object). If it's for use in your custom component or other components, you'd need to write model logic to pull the information from the database. In that case, I'd look at how the sellacious model is doing it and copy just the parts you need.

syntax error, unexpected $end in C:\xampp\... on line 161 [duplicate]

This question already has answers here:
Reference - What does this error mean in PHP?
(38 answers)
Closed 8 years ago.
I get the following error when I open the index page:
Parse error: syntax error, unexpected $end in C:\xampp\htdocs\... on
line 161
Here is the code:
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<title>
<?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home / front page.
$site_description = get_bloginfo( 'description', 'display' );
if( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'bootstrapwp' ), max( $paged, $page ) );
?>
</title>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php
if( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="icon.jpg">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-57-precomposed.png">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php wp_head(); ?>
<?php include 'storeclass.php'; ?>
<style>
.navbar .nav li a
{
padding-right: 0px !important;
}
</style>
<?php
if( function_exists( 'teboAnalytic' ) ){
teboAnalytic();
}
?>
</head>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<style>
.container
{
max-width: 300px;
}
</style>
<body style="background-color: #E7EBF2;padding-top:65px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php
}
else
{
?>
<body style="background-color: #E7EBF2;padding-top:45px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php
} ?>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container" style="width:940px;">
<ul class="nav">
<li class="hidden-phone">
<img src="<?php echo BASE_URL.'weblogo.png'; ?>" style="width:270px;">
</li>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<li class="dropdown" style="margin-left:15px;">
<?php
}
else
{
?>
<li class="dropdown offset2">
<?php
} ?>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" style="padding:0;">
<img src="<?php echo BASE_URL; ?>callus.png" style="height:46px;width:203px">
</a>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
callUsBanner('mobile');
}
else
{
callUsBanner('desktop');
}
?>
</li><!-- Regular Menu Ends -->
<li class="divider-vertical">
</li>
</ul>
</div>
</div>
</div>
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<link rel="stylesheet" href="mobile-custom.css" />
<style>
.hhd
{
display: inline-block;
height: 5px;
width: 100%;
}
</style>
<?php
} ?>
<div class="container hhd" style="height:41px;">
<?php
if($detect->isMobile() AND !$detect->isTablet()){
?>
<img src="weblogo.png" style="width:270px;">
<div class="row">
<div class="styled-select blue semi-square divsel span12">
<?php menu1(); ?>
</div>
</div>
<?
} ?>
<div class="subnavbar navbar navbar hidden-phone">
<div class="navbar-inner subnav">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar">
</span>
<span class="icon-bar">
</span>
<span class="icon-bar">
</span>
</button>
<ul class="nav" style="font-size:13px;">
<li class="hidden-phone">
<img src="badge.jpg" style="width:40px;">
</li>
<li class="hidden-phone">
<a href="" style="padding-right: 5px;">
<i class="icon-home">
</i>Home
</a>
</li>
<li class="hidden-phone">
<a href="">
<i class=" icon-th-large">
</i>Store
</a>
</li>
<li class="hidden-phone">
<a href="">
<i class=" icon-tag">
</i>Bursa
</a>
</li>
<li class="divider-vertical subnav">
</li>
<?php menuIjo('desktop','top'); ?>
</ul>
</div>
</div>
</div>
</div>
<script>
$('.renav').click(function(e)
{
//alert('ha');
$('section.dropdown-menu *').removeAttr('data-toggle');
});
</script>
<!-- End Header -->
<!-- Begin Template Content -->
could you help me to solve this problem?
thanks
replace
<? with <?php on line number 132 ( <? } ?> to <?php } ?>
the correct code will be
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<title><?php
/*
* Print the <title> tag based on what is being viewed.
*/
global $page, $paged;
wp_title( '|', true, 'right' );
// Add the blog name.
bloginfo( 'name' );
// Add the blog description for the home/front page.
$site_description = get_bloginfo( 'description', 'display' );
if ( $site_description && ( is_home() || is_front_page() ) )
echo " | $site_description";
// Add a page number if necessary:
if ( $paged >= 2 || $page >= 2 )
echo ' | ' . sprintf( __( 'Page %s', 'bootstrapwp' ), max( $paged, $page ) );
?></title>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php if ( is_singular() && get_option( 'thread_comments' ) ) wp_enqueue_script( 'comment-reply' ); ?>
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="icon.jpg">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="<?php bloginfo( 'template_url' );?>/ico/apple-touch-icon-57-precomposed.png">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<?php wp_head(); ?>
<?php include 'storeclass.php'; ?>
<style>
.navbar .nav li a{
padding-right: 0px !important;
}
</style>
<?php
if ( function_exists( 'teboAnalytic' ) ) {
teboAnalytic();
}
?>
</head>
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<style>
.container{
max-width:300px;
}
</style>
<body style="background-color: #E7EBF2;padding-top:65px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php }else{?>
<body style="background-color: #E7EBF2;padding-top:45px;" <?php body_class(); ?> data-spy="scroll" data-target=".bs-docs-sidebar" data-offset="10">
<?php } ?>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container" style="width:940px;">
<ul class="nav">
<li class="hidden-phone">
<img src="<?php echo BASE_URL.'weblogo.png'; ?>" style="width:270px;">
</li>
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<li class="dropdown" style="margin-left:15px;">
<?php }else{ ?>
<li class="dropdown offset2">
<?php } ?>
<img src="<?php echo BASE_URL; ?>callus.png" style="height:46px;width:203px">
<?php if ($detect->isMobile() AND !$detect->isTablet()) {
callUsBanner('mobile');
}else{
callUsBanner('desktop');
}
?>
</li><!-- Regular Menu Ends -->
<li class="divider-vertical"></li>
</ul>
</div>
</div>
</div>
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<link rel="stylesheet" href="mobile-custom.css" />
<style>
.hhd{
display:inline-block;
height:5px;
width:100%;
}
</style>
<?php } ?>
<div class="container hhd" style="height:41px;">
<?php if ($detect->isMobile() AND !$detect->isTablet()) {?>
<img src="weblogo.png" style="width:270px;">
<div class="row">
<div class="styled-select blue semi-square divsel span12">
<?php menu1(); ?>
</div>
</div>
<?php } ?>
<div class="subnavbar navbar navbar hidden-phone">
<div class="navbar-inner subnav">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<ul class="nav" style="font-size:13px;">
<li class="hidden-phone"><img src="badge.jpg" style="width:40px;"></li>
<li class="hidden-phone"><i class="icon-home"></i>Home</li>
<li class="hidden-phone"><i class=" icon-th-large"></i>Store</li>
<li class="hidden-phone"><i class=" icon-tag"></i>Bursa</li>
<li class="divider-vertical subnav"></li>
<?php menuIjo('desktop','top'); ?>
</ul>
</div>
</div>
</div>
</div>
<script>
$('.renav').click(function(e){
//alert('ha');
$('section.dropdown-menu *').removeAttr('data-toggle');
});
</script>
<!-- End Header -->
<!-- Begin Template Content -->

Categories