I just import the lightbox2 on my project but I dont know how to add lightbox2 on advanced custom fields?
$images = get_field('gallery');
if( $images ): ?>
<ul>
<?php foreach( $images as $image ): ?>
<li>
<a href="<?php echo esc_url($image['url']); ?>">
<img src="<?php echo esc_url($image['sizes']['thumbnail']); ?>" alt="<?php echo esc_attr($image['alt']); ?>" />
</a>
<p><?php echo esc_html($image['caption']); ?></p>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?> ```
I’m validating my website for W3C validator.
I get this error on Firefox:
Start tag "a" seen but and element of the same type was already open.
End tag "a" violates nesting roles.
End tag "a" violates nesting roles.
this is my code:
<div class="products_index_plus">
<a href="<?php the_permalink(); ?>">
<img alt="<?php the_title(); ?>" title="<?php the_title(); ?>" src="<?php echo wp_get_attachment_image_url(get_post_thumbnail_id(), $settings['sigma_image_size']); ?>">
<?php if ('yes' == $settings['sigma_show_badge']) : ?>
<div class="sigma-wc-products-badge">
<?php woocommerce_show_product_loop_sale_flash(); ?>
</div>
<?php endif; ?>
<!-- popup content -->
<?php if($settings['sigma_open_thumb_in_popup'] === 'yes') :
?>
<div class="sigma-wc-product-popop">
<div class="sigma-fast-preview" data-product-id="<?php echo get_the_ID() ?>">
<a class="sigma-wc-product-popop--link"><i class="fa fa-eye" aria-hidden="true"></i></a>
</div>
</div>
<?php endif; ?>
</a>
</div>
I am trying to load my sign in page, but I get the error that:
Message: in_array() expects parameter 2 to be array, boolean given
Filename: views/sign_in.php
Line Number: 23(<?php if(in_array("ldap",$this->config->item("validation"))): ?>)
and in line 103 ..... where am I going wrong?
MY CODE
<!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">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo lang('website_title')." : " .
lang('sign_in_page_name');
?></title>
<?php echo $this->load->view('meta'); ?>
<base href="<?php echo base_url(); ?>" />
<link type="text/css" rel="stylesheet"
href="resource/css/960gs/960gs.css"
/>
<link type="text/css" rel="stylesheet" href="resource/css/style.css" />
</head>
<body>
<?php echo $this->load->view('header'); ?>
<div id="content">
<div class="container_12">
<?php echo $this->load->view('logo'); ?>
<?php if(in_array("ldap",$this->config->item("validation"))): ?>
<div class="grid_12">
<h2><?php echo anchor(uri_string().($this->input-
>get('continue')?'/?continue='.urlencode($this->input-
>get('continue')):''), lang('sign_in_page_name')); ?></h2>
</div>
<div class="clear"></div>
<div id="ldap_validation" >
<?php echo form_open(uri_string()."/sign_in_ldap".($this->input-
>get('continue')?'/?continue='.urlencode($this->input-
>get('continue')):'')); ?>
<?php echo form_fieldset(); ?>
<h3><?php echo lang('windows_validation'); ?></h3>
<div class="grid_2 alpha">
<?php echo form_label(lang('sign_in_ldap_username'),
'sign_in_ldap_username'); ?>
</div>
<div class="grid_4 omega">
<?php echo form_input(array(
'name' => 'sign_in_ldap_username',
'id' => 'sign_in_ldap_username',
'value' => set_value('sign_in_ldap_username'),
'maxlength' => '255'
)); ?>
<?php echo form_error('sign_in_ldap_username'); ?>
<?php if (isset($sign_in_ldap_username_error)) : ?>
<span class="field_error"><?php echo
$sign_in_ldap_username_error; ?></span>
<?php endif; ?>
</div>
<div class="clear"></div>
<div class="grid_2 alpha">
<?php echo form_label(lang('sign_in_ldap_password'),
'sign_in_ldap_password'); ?>
</div>
<div class="grid_4 omega">
<?php echo form_password(array(
'name' => 'sign_in_ldap_password',
'id' => 'sign_in_ldap_password',
'value' => set_value('sign_in_ldap_password')
)); ?>
<?php echo form_error('sign_in_ldap_password'); ?>
</div>
<div class="clear"></div>
<?php if (isset($recaptcha)) : ?>
<div class="prefix_2 grid_4 alpha omega">
<?php echo $recaptcha; ?>
</div>
<?php if (isset($sign_in_recaptcha_error)) : ?>
<div class="prefix_2 grid_4 alpha omega">
<span class="field_error"><?php echo
$sign_in_recaptcha_error; ?></span>
</div>
<?php endif; ?>
<div class="clear"></div>
<?php endif; ?>
<div class="prefix_2 grid_4 alpha omega">
<span>
<?php echo form_button(array(
'type' => 'submit',
'class' => 'button',
'content' => lang('sign_in_ldap_sign_in')
)); ?>
</span>
<span>
<?php echo form_checkbox(array(
'name' => 'sign_in_ldap_remember',
'id' => 'sign_in_ldap_remember',
'value' => 'checked',
'checked' => $this-
>input>post('sign_in_ldap_remember'),
'class' => 'checkbox'
)); ?>
<?php echo form_label(lang('sign_in_ldap_remember_me'),
'sign_in_ldap_remember'); ?>
</span>
</div>
<div class="clear"></div>
<div class="prefix_2 grid_4 alpha omega">
<p><?php echo lang('sign_in_ldap_forgot_your_password'); ?>
<br />
<?php echo sprintf(lang('sign_in_ldap_dont_have_account'),
lang('sign_in_ldap_sign_up_now')); ?></p>
</div>
<div class="clear"></div>
<?php echo form_fieldset_close(); ?>
<?php echo form_close(); ?>
</div>
<?php endif; ?>
<?php if (in_array("simple",$this->config->item("validation"))): ?>
<div class="grid_12">
<?php if (in_array("ldap",$this->config-
>item("validation"))): ?>
<h2>Or</h2>
<?php else: ?>
<h2><?php echo anchor(uri_string().($this->input-
>get('continue')?'/?continue='.urlencode($this->input-
>get('continue')):''), lang('sign_in_page_name')); ?></h2>
<?php endif; ?>
</div>
<div class="clear"></div>
<div class="grid_6">
<?php echo form_open(uri_string().($this->input-
>get('continue')?'/?continue='.urlencode($this->input-
>get('continue')):'')); ?>
<?php echo form_fieldset(); ?>
<h3><?php echo lang('sign_in_heading'); ?></h3>
<?php if (isset($sign_in_error)) : ?>
<div class="grid_6 alpha omega">
<div class="form_error"><?php echo $sign_in_error; ?></div>
</div>
<div class="clear"></div>
<?php endif; ?>
<div class="grid_2 alpha">
<?php echo form_label(lang('sign_in_username_email'),
'sign_in_username_email'); ?>
</div>
<div class="grid_4 omega">
<?php echo form_input(array(
'name' => 'sign_in_username_email',
'id' => 'sign_in_username_email',
'value' => set_value('sign_in_username_email'),
'maxlength' => '24'
)); ?>
<?php echo form_error('sign_in_username_email'); ?>
<?php if (isset($sign_in_username_email_error)) : ?>
<span class="field_error"><?php echo
$sign_in_username_email_error; ?></span>
<?php endif; ?>
</div>
<div class="clear"></div>
<div class="grid_2 alpha">
<?php echo form_label(lang('sign_in_password'),
'sign_in_password'); ?>
</div>
<div class="grid_4 omega">
<?php echo form_password(array(
'name' => 'sign_in_password',
'id' => 'sign_in_password',
'value' => set_value('sign_in_password')
)); ?>
<?php echo form_error('sign_in_password'); ?>
</div>
<div class="clear"></div>
<?php if (isset($recaptcha)) : ?>
<div class="prefix_2 grid_4 alpha omega">
<?php echo $recaptcha; ?>
</div>
<?php if (isset($sign_in_recaptcha_error)) : ?>
<div class="prefix_2 grid_4 alpha omega">
<span class="field_error"><?php echo
$sign_in_recaptcha_error; ?></span>
</div>
<?php endif; ?>
<div class="clear"></div>
<?php endif; ?>
<div class="prefix_2 grid_4 alpha omega">
<span>
<?php echo form_button(array(
'type' => 'submit',
'class' => 'button',
'content' => lang('sign_in_sign_in')
)); ?>
</span>
<span>
<?php echo form_checkbox(array(
'name' => 'sign_in_remember',
'id' => 'sign_in_remember',
'value' => 'checked',
'checked' => $this->input-
>post('sign_in_remember'),
'class' => 'checkbox'
)); ?>
<?php echo form_label(lang('sign_in_remember_me'),
'sign_in_remember'); ?>
</span>
</div>
<div class="clear"></div>
<div class="prefix_2 grid_4 alpha omega">
<p><?php echo anchor('account/forgot_password',
lang('sign_in_forgot_your_password')); ?><br />
<?php echo sprintf(lang('sign_in_dont_have_account'),
anchor('account/sign_up', lang('sign_in_sign_up_now'))); ?></p>
</div>
<div class="clear"></div>
<?php echo form_fieldset_close(); ?>
<?php echo form_close(); ?>
</div>
<div class="grid_6">
<h3><?php echo sprintf(lang('sign_in_third_party_heading')); ?>
</h3>
<ul>
<?php foreach($this->config-
>item('third_party_auth_providers') as $provider) : ?>
<li class="third_party <?php echo $provider; ?>"><?php echo
anchor('account/connect_'.$provider, lang('connect_'.$provider),
array('title'=>sprintf(lang('sign_in_with'),
lang('connect_'.$provider)))); ?></li>
<?php endforeach; ?>
</ul>
<div class="clear"></div>
</div>
<div class="clear"></div>
</div>
<?php endif; ?>
</div>
<?php echo $this->load->view('footer'); ?>
</body>
</html>
The error message is:
Severity: Warning
Message: in_array() expects parameter 2 to be array, boolean given
Filename: views/sign_in.php
Line Number: 23
High chances that $this->config->item("validation") is a boolean, but you are trying to find strings 'simple' and 'ldap' inside it like in array.
This is, probably, your problem, but I can't really help solving it, because I don't quite understand what are you trying to achieve with this code.
<?php if (in_array("simple",$this->config->item("validation"))): ?>
<?php if(in_array("ldap",$this->config->item("validation"))): ?>
my code to get data
$db = mysql_connect("localhost","root","","news");
mysql_query("set names 'utf8'");
$result = mysql_query($db, "SELECT * FROM news_list order by id LIMIT 0,4");
while ($row = mysqli_fetch_array($result))
{ ?>
<li>
<a href="#?id=<?php echo $row['id']; ?>" class="">
<div class="">
<img width="64" height="64" src="<?php echo $row['images']; ?>" class="" alt="" itemprop="image" /> </div>
<div class="">
<?php echo substr($row['description'], 0, 50); ?> తెలుగు </div>
</a>
</li>
<?php } ?>
in this just i need to add set character set utf8
You can try instead
$db = mysql_connect("localhost","root","","news");
mysql_set_charset('utf8',$db);
$result = mysql_query($db, "SELECT * FROM news_list order by id LIMIT 0,4");
while ($row = mysqli_fetch_array($result))
{ ?>
<li>
<a href="#?id=<?php echo $row['id']; ?>" class="">
<div class="">
<img width="64" height="64" src="<?php echo $row['images']; ?>" class="" alt="" itemprop="image" /> </div>
<div class="">
<?php echo substr($row['description'], 0, 50); ?>
</div>
</a>
</li>
<?php } ?>
I have custimized the css of my joomla login page, everything is perfect, but I would like the image that I have inserted in the background through css to scale to whole width. Right now it is of a certain width size, despite the fact that in my css I have added width:100%.
Here is the login code:
<?php
/**
* #package Joomla.Site
* #subpackage com_users
* #copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
* #license GNU General Public License version 2 or later; see LICENSE.txt
* #since 1.5
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
?>
<div class="login<?php echo $this->pageclass_sfx?>">
<?php //if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1 class="title">
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php //endif; ?>
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
<div class="login-description">
<?php endif ; ?>
<?php if (($this->params->get('login_image')!='')) :?>
<img src="<?php echo $this->escape($this->params->get('login_image')); ?>" class="login-image" alt="<?php echo JTEXT::_('COM_USER_LOGIN_IMAGE_ALT')?>"/>
<?php endif; ?>
<?php if($this->params->get('logindescription_show') == 1) : ?>
<?php echo $this->params->get('login_description'); ?>
<?php endif; ?>
<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
</div>
<?php endif ; ?>
<form class="form-horizontal" action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post">
<fieldset class="well">
<?php foreach ($this->form->getFieldset('credentials') as $field): ?>
<?php if (!$field->hidden): ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
<div class="control-group">
<label id="remember-lbl" class="control-label" for="remember"><?php echo JText::_('JGLOBAL_REMEMBER_ME') ?></label>
<input id="remember" type="checkbox" name="remember" class="inputbox" value="yes" alt="<?php echo JText::_('JGLOBAL_REMEMBER_ME') ?>" />
</div>
<?php endif; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn-send"><?php echo JText::_('JLOGIN'); ?></button>
<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('login_redirect_url', $this->form->getValue('return'))); ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</div>
</fieldset>
</form>
</div>
<div class="other-link">
<ul class="yt-list type-square">
<li class="pull-left">
<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?></a>
</li>
<?php
$usersConfig = JComponentHelper::getParams('com_users');
if ($usersConfig->get('allowUserRegistration')) : ?>
<li class="pull-right">
<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>">
<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?></a>
</li>
<?php endif; ?>
</ul>
</div>
Don't modify core Joomla files, learn about overrides (1, 2 & 3) and use them, that way when a security update is released you can apply it safely and not have to worry about your changes being overwritten.
Did you mean backgroud-size: 100% rather than width: 100%? That would make more sense for background images. In that case, I would recommend reading this primer on "Scaling background images"
To help further we will need to see your existing CSS that you've created and either a link showing the problem or a good screen shot of the issue.