how to add lightbox2 on acf? - advanced-custom-fields

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; ?> ```

Related

HTML Validation w3 Validator

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>

Solving an Array error in codeigniter framework

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"))): ?>

CSS / HTML - stray dash appearing on hover

I have a section on a site containing logos for product partners. There's around 28 logos in all - 10 of them are links to separate product pages. When I hover over them there's a stray dash that appears in the bottom right-hand corner and I cannot find where this is coming from and it's sending me crazy. It appears on all the linked logo images except the last one - again I can't see the difference with this one. This is what I mean -
Logo with dash appearing
Without dash
It looks like a stray dash from a page of code but I can't see anything -
partners.php
<div class="row">
<div id="partnerimages" class="col-md">
<a href="<?php the_permalink(76); ?>" id="adia">
<?php if( get_field('axe_img') ): ?>
<img src="<?php the_field('axe_img'); ?>" />
<?php endif; ?>
</a>
<?php if( get_field('beachrotana_img') ): ?>
<img src="<?php the_field('beachrotana_img'); ?>" />
<?php endif; ?>
<a href="<?php the_permalink(78); ?>" id="adia">
<?php if( get_field('bloom_img') ): ?>
<img src="<?php the_field('bloom_img'); ?>" />
<?php endif; ?>
</a>
<a href="<?php the_permalink(80); ?>" id="adia">
<?php if( get_field('bodytree_img') ): ?>
<img src="<?php the_field('bodytree_img'); ?>" />
<?php endif; ?>
</a>
<a href="<?php the_permalink(82); ?>" id="adia">
<?php if( get_field('certo_img') ): ?>
<img src="<?php the_field('certo_img'); ?>" />
<?php endif; ?>
</a>
<?php if( get_field('daphne_img') ): ?>
<img src="<?php the_field('daphne_img'); ?>" />
<?php endif; ?>
<?php if( get_field('ecolab_img') ): ?>
<img src="<?php the_field('ecolab_img'); ?>" />
<?php endif; ?>
<a href="<?php the_permalink(84); ?>" id="adia">
<?php if( get_field('fish_img') ): ?>
<img src="<?php the_field('fish_img'); ?>" />
<?php endif; ?>
</a>
<?php if( get_field('fsw_img') ): ?>
<img src="<?php the_field('fsw_img'); ?>" />
<?php endif; ?>
<?php if( get_field('gloss_img') ): ?>
<img src="<?php the_field('gloss_img'); ?>" />
<?php endif; ?>
<a href="<?php the_permalink(86); ?>" id="adia">
<?php if( get_field('guy_img') ): ?>
<img src="<?php the_field('guy_img'); ?>" />
<?php endif; ?>
</a>
<?php if( get_field('happiness_img') ): ?>
<img src="<?php the_field('happiness_img'); ?>" />
<?php endif; ?>
<?php if( get_field('herbal_img') ): ?>
<img src="<?php the_field('herbal_img'); ?>" />
<?php endif; ?>
<?php if( get_field('ignite_img') ): ?>
<img src="<?php the_field('ignite_img'); ?>" />
<?php endif; ?>
<?php if( get_field('js_img') ): ?>
<img src="<?php the_field('js_img'); ?>" />
<?php endif; ?>
<?php if( get_field('khalidya_img') ): ?>
<img src="<?php the_field('khalidya_img'); ?>" />
<?php endif; ?>
<a href="<?php the_permalink(88); ?>" id="adia">
<?php if( get_field('lucky_img') ): ?>
<img src="<?php the_field('lucky_img'); ?>" />
<?php endif; ?>
</a>
<a href="<?php the_permalink(90); ?>" id="adia">
<?php if( get_field('lux_img') ): ?>
<img src="<?php the_field('lux_img'); ?>" />
<?php endif; ?>
</a>
<?php if( get_field('madiso_img') ): ?>
<img src="<?php the_field('madiso_img'); ?>" />
<?php endif; ?>
<?php if( get_field('maria_img') ): ?>
<img src="<?php the_field('maria_img'); ?>" />
<?php endif; ?>
<?php if( get_field('prca_img') ): ?>
<img src="<?php the_field('prca_img'); ?>" />
<?php endif; ?>
<?php if( get_field('qcomm_img') ): ?>
<img src="<?php the_field('qcomm_img'); ?>" />
<?php endif; ?>
<?php if( get_field('radwater_img') ): ?>
<img src="<?php the_field('radwater_img'); ?>" />
<?php endif; ?>
<?php if( get_field('radmedia_img') ): ?>
<img src="<?php the_field('radmedia_img'); ?>" />
<?php endif; ?>
<a href="<?php the_permalink(92); ?>" id="adia">
<?php if( get_field('shangri_img') ): ?>
<img src="<?php the_field('shangri_img'); ?>" />
<?php endif; ?>
</a>
<?php if( get_field('sofrank_img') ): ?>
<img src="<?php the_field('sofrank_img'); ?>" />
<?php endif; ?>
<a href="<?php the_permalink(94); ?>" id="adia">
<?php if( get_field('tips_img') ): ?>
<img src="<?php the_field('tips_img'); ?>" />
<?php endif; ?>
</a>
<a href="<?php the_permalink(96); ?>" id="adia">
<?php if( get_field('xbd_img') ): ?>
<img src="<?php the_field('xbd_img'); ?>" />
<?php endif; ?>
</a>
</div>
</div>
If it's not from the text editor where else could it be? I've checked the pages and the ACF's. Can anyone assist / see anything I can't?
In HTML, white space is "normalized". This means that multiple white space characters in a row will be compacted down to a single white space character. But, it also means that other non-printable characters are converted to space characters, including carriage returns.
So, if you write a hyperlink like this:
Some content
There only content of the a element is the text and all of that text is what will be clickable and, if underlining is applied, all the text will be underlined.
But, in your case your code basically works out to be like this:
<a href="somePath">
<img src="somePath"></a>
Which puts a carriage return inside the opening and closing a element and that carriage return gets converted to a space and that space is now part of the content of the element. If underlining gets applied, that space will get underlined.
So, you can just re-work your HTML structure to not include carriage returns in your code or you can turn off underlining for links with the following CSS:
a { text-decoration:none; }
This will solve the problem for sure:
#partnerimages a:hover {text-decoration:none!important;}
You are seeing an underline, not a dash.

I want to make the background image of joomla login be full width

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.

google map showing location from property form

I am trying to make a form for showing properties:
My form looks like this below, how can i get the google map to show the location of the property?
<legend><?php echo JText::_('COM_IPROPERTY_LOCATION'); ?></legend>
<div class="formelm"><?php echo $this->form->getLabel('hide_address'); ?>
<?php echo $this->form->getInput('hide_address'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('street_num'); ?>
<?php echo $this->form->getInput('street_num'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('street'); ?>
<?php echo $this->form->getInput('street'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('street2'); ?>
<?php echo $this->form->getInput('street2'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('apt'); ?>
<?php echo $this->form->getInput('apt'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('city'); ?>
<?php echo $this->form->getInput('city'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('postcode'); ?>
<?php echo $this->form->getInput('postcode'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('locstate'); ?>
<?php echo $this->form->getInput('locstate'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('province'); ?>
<?php echo $this->form->getInput('province'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('country'); ?>
<?php echo $this->form->getInput('country'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('region'); ?>
<?php echo $this->form->getInput('region'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('county'); ?>
<?php echo $this->form->getInput('county'); ?></div>
</fieldset>
<fieldset>
<legend><?php echo JText::_( 'COM_IPROPERTY_DRAG_AND_DROP' ); ?></legend>
<?php echo $this->form->getLabel('geocode_header'); ?>
<div class="formelm"><?php echo $this->form->getLabel('latitude'); ?>
<?php echo $this->form->getInput('latitude'); ?></div>
<div class="formelm"><?php echo $this->form->getLabel('longitude'); ?>
<?php echo $this->form->getInput('longitude'); ?></div>
<div><?php echo $this->form->getInput('google_map'); ?></div>
</fieldset>
</div>
Create a Google Map and add a marker on top of it. It seems you have already got the latitude and longitude, so creating the map should be quite simple like in this example. This should be a starting point for your further development of your map.
function initialize() {
var myLatlng = new google.maps.LatLng(<?php echo $this->form->getInput('latitude'); ?>,<?php echo $this->form->getInput('longitude'); ?>);
var mapOptions = {
zoom: 4,
center: myLatlng,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
var map = new google.maps.Map(document.getElementById('map_canvas'), mapOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map: map,
title: 'Hello World!'
});
}