I have an gallery.php file.It consist Albums and it's gallery images. My problem is when I click on Album image, Gallery images start to showing from images 4/4 then 3/4 and so on.
gallery.php
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/lightbox-plus-jquery.min.js"></script>
<div class="menu-port">
<div class="container">
<div class="menu-grid-main">
<?php
include("database/connection.php");
$result=mysql_query("SELECT * from Album_image where status='process'");
while ($row1= mysql_fetch_array($result)) {
?>
<div class="col-md-4 menu-grid wow bounceInDown" data-wow-delay="0.3s">
<?php
include("database/connection.php");
$result1=mysql_query("SELECT * from Gallery_image where aid=$row1[aid]");
while ($row2= mysql_fetch_array($result1)) {
?>
<a href="admin/gcatch//<?php echo $row2['image'] ?>" data-lightbox="<?php echo $row1['name']?>" >
<?php }?>
<img src="admin/acatch/<?php echo $row1['image'] ?>" alt="" class="img-responsive">
</a>
<h3><?php echo $row1['name']?></h3>
<p><?php echo $row1['des']?></p>
</div>
<?php }?>
<div class="clearfix"> </div>
</div>
</div>
</div>
I used lightbox effect to showing gallery images
Please anyone help me to showing image proper format
there is syntax issue. try this
<div class="menu-port">
<div class="container">
<div class="menu-grid-main">
<?php
include("database/connection.php");
$result=mysql_query("SELECT * from Album_image where status='process'");
while ($row1= mysql_fetch_array($result)) {
?>
<?php
include("database/connection.php");
$result1=mysql_query("SELECT * from Gallery_image where aid=$row1[aid]");
while ($row2= mysql_fetch_array($result1)) {
?>
<div class="col-md-4 menu-grid wow bounceInDown" data-wow-delay="0.3s">
<a href="admin/gcatch//<?php echo $row2['image'] ?>" data-lightbox="<?php echo $row1['name']?>" >
<img src="admin/acatch/<?php echo $row1['image'] ?>" alt="" class="img-responsive">
</a>
<h3><?php echo $row1['name']?></h3>
<p><?php echo $row1['des']?></p>
</div>
<?php }?>
<?php }?>
<div class="clearfix"> </div>
</div>
</div>
</div>
this query is better for fetch data
"SELECT * from Gallery_image where aid=$row1[aid] ORDER BY id DESC"
ordering result is best way to figure out what data in what order is fetching
REMEMBER : mysql_* functions (mysql_connect OR mysql_query) are deprecated ! you should use PDO or at least mysqli functions
here is some resource to learn PDO : PDO and mysqli
/ intro to PDO (laracast tutorial)
Related
my uploaded image are not showing on webpage.
<div class="col-md-8 news-item">
<a href="<?php echo base_url('home/newsdetail/'); ?><?php echo $newsdetail[0]['id']; ?>" style="text-decoration: none; color:black;" >
<h1><?php echo $newsdetail[0]['heading']; ?></h1>
</a>
<p class="author-name"><?php echo $newsdetail[0]['staffname']; ?> <span class="time"><i class="fa fa-clock-o"></i><?php echo date("d-m-Y H:i:s",strtotime($newsdetail[0]['created_date'])); ?></span></p>
<div class="read-img">
<?php if($newsdetail[0]['image']==''){ ?>
<img class="img-responsive" src="<?php echo base_url('assets/img/noimage.gif')?>" height="70"/>
<?php } else { ?>
<?php $multiimage=explode(",",$newsdetail[0]['image']); ?>
<div id="jssor_1" style="position:relative;margin:0 auto;top:0px;left:0px;width:980px;height:480px;overflow:hidden;visibility:hidden;">
<!-- Loading Screen -->
<div data-u="loading" class="jssorl-009-spin" style="position:absolute;top:0px;left:0px;width:100%;height:100%;text-align:center;background-color:rgba(0,0,0,0.7);">
<img style="margin-top:-19px;position:relative;top:50%;width:38px;height:38px;" src="//jssorcdn7.azureedge.net/theme/svg/loading/static-svg/spin.svg" />
</div>
<div data-u="slides" style="cursor:default;position:relative;top:0px;left:0px;width:980px;height:380px;overflow:hidden;">
<?php foreach($multiimage as $imgrow){ ?>
<div>
<img data-u="image" src="<?php echo base_url('uploads/newsimages/'); ?><?php echo $imgrow; ?>" />
<img data-u="thumb" src="<?php echo base_url('uploads/newsimages/'); ?><?php echo $imgrow; ?>" />
</div>
<?php } ?>
</div>
First, try to print image path array. see if those are correct.
<?php
$multiimage=explode(",",$newsdetail[0]['image']);
print_r($multiimage);
?>
Then make sure those images are in the right directory.
Also for debugging purpos try printing the path if it's ok. you can check the image by simply putting the path on a browser URL.
<?php echo base_url('uploads/newsimages/').$imgrow ?>
I have a Wordpress + Webpack theme with a custom post type archive page for careers. Problem is that none of the links are clickable in the content (breacrumbs (yoast module), content links, post permalinks). The issue appeared recently. The header menu works fine.
So far I've tried:
removing the content text: no effect
remove post listing to see if the issue is related to the listing only
Tried moving the post loop to another template: still not clickable
absolute position css to see if anything is overlapping: no effect
remove all styles, leave only html: no effect
disabling all plugins: no effect.
oddly it works from time-to-time on safari but cant see a logic in it (but not firefox, opera, chrome)
Issue is not present on local install either (codebase for theme is the same)
The jobs listing archive template looks as follows:
<?php /* Template Name: Jobs */ ?>
<?php get_header(); ?>
<div id="primary" class="content-area">
<main id="main" class="site-main" role="main">
<div class="page-content">
<div class="jobs-listing">
<div class="blob-wrap">
<div class="blob blob-right-top"><img src="<?php bloginfo('template_url'); ?>/assets/page-blob_4.svg" alt="NEXD Blob"></div>
<div class="blob blob-left-top is-hidden-mobile"><img src="<?php bloginfo('template_url'); ?>/assets/blog-blob.svg" alt="NEXD Blob"></div>
<div class="blob blob-left-bottom"><img src="<?php bloginfo('template_url'); ?>/assets/table-blob-left.svg" alt="NEXD Blob"></div>
</div>
<div class="positions-wrap above-fold_wrap">
<div class="container positions-container">
<div class="breadcrumbs">
<?php if ( function_exists('yoast_breadcrumb') ) { yoast_breadcrumb('<p id="breadcrumbs">','</p>'); } ?>
</div><!-- breadcrumbs -->
<div class="columns is-centered" data-aos="fade-up">
<div class="column">
<div class="positions-title has-text-centered columns is-centered">
<div class="column is-8">
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<?php the_content(); ?>
<?php endwhile; endif; ?>
<img src="<?php bloginfo('template_url'); ?>/assets/scroll-mouse--blue.svg" alt="Scroll icon">
</div>
</div><!-- title -->
<div class="positions columns">
<?php $args = array(
'post_type' => 'jobs',
'posts_per_page' => -1, //show all posts
);
$posts = new WP_Query($args); if( $posts->have_posts() ): while( $posts->have_posts() ) : $posts->the_post(); ?>
<div class="column">
<a href="<?php echo get_permalink(); ?>" title="Read more about <?php echo get_the_title(); ?>">
<div class="positions-inner">
<div class="position-title">
<h3><?php echo get_the_title(); ?></h3>
</div>
<div class="position-link">
<span><?php the_field('starting_from'); ?></span>
</div>
<div class="position-locations">
<img src="<?php bloginfo('template_url'); ?>/assets/icon-map--pin.svg" alt="map-pin"><span class="location-name"><?php the_field('location'); ?></span>
</div>
</div>
</a>
</div>
<?php endwhile; endif; ?>
<?php wp_reset_postdata(); ?>
</div>
</div><!-- column is-10 -->
</div><!-- columns -->
</div><!-- container -->
</div><!-- positions -->
</div><!-- jobs listing-->
</div>
</div>
</div><!-- .content-area -->
<?php get_footer(); ?>
When I switch to the common template, all links in content work and rest of the site is fine.
View here
I test your website, if you click the link before an external/internal source is loaded the link work.
So you have 2 option, try to find which of that source block your link or use this code for exceed the problem:
<div class="column">
<div class="positions-inner">
<a href="https://www.nexd.com/career/technical-writer/" title="Read more about
Technical Writer">
<div class="position-title">
<h3>Technical Writer</h3>
</div>
<div class="position-link">
<span>ASAP</span>
</div>
<div class="position-locations">
<img src="https://www.nexd.com/wp-content/themes/nexd_theme/assets/icon-map--pin.svg"
alt="map-pin"><span class="location-name">Tallinn, Estonia</span>
</div>
</a>
</div>
</div>
This is with php code:
<div class="column">
<div class="positions-inner">
<a href="<?php echo get_permalink(); ?>" title="Read more about <?php echo
get_the_title(); ?>">
<div class="position-title">
<h3><?php echo get_the_title(); ?></h3>
</div>
<div class="position-link">
<span><?php the_field('starting_from'); ?></span>
</div>
<div class="position-locations">
<img src="<?php bloginfo('template_url'); ?>/assets/icon-map--pin.svg" alt="map-pin"><span class="location-name"><?php the_field('location'); ?></span>
</div>
</a>
</div>
</div>
I have a page in which a user is able to select his desired category and get a listing of organizations. As for now, I've managed to get data from one selected category.
My issue now is getting multiple selected categories and retrieve data from multiple ids.
List of categories:
<div class="col-md-4 sidebar well col-md-push-8">
<div class="sidebar__block">
<div class="sidebar__inner">
<h4 class="h4">Filter by category</h4>
<?php foreach ($categories as $c): ?>
<div class="form-group">
<div class="checkbox">
<input type="checkbox" name="category[]" id="<?php echo $c->id;?>" value="<?php echo $c->id;?>" class="styled" <?php if($c->id==$_GET['category']){ echo 'checked="checked"'; } ?>>
<label for="<?php echo $c->title; ?>"><?php echo $c->title;?></label>
</div>
</div>
<?php endforeach ?>
<div class="form-group">
<button type="submit" class="btn btn-sd btn-sd-green full-width filter_button" name="subscribe">Filter <i class="icon-right-small"></i></button>
</div>
</div>
</div>
</div>
List of data(organizations according to category selected):
<div class="col-md-8 col-md-pull-4">
<!--start show category with title-->
<div class="lgi__block lgi__block-2" id="appnendGridId">
<!--start show single category with title-->
<?php if(!empty($enterprises)): ?>
<?php foreach ($enterprises as $e): ?>
<div class="lgi__item category1">
<a class="lgi__item-inner" target="_blank" href="<?php echo $this->createUrl('frontend/enterprise', array('id' => $e->id)) ?>">
<div class="lgi__block-img">
<h5 class="lgi__label"><?php if($e->isIdeaEnterpriseActiveAccreditedMembership()): ?><?php echo $e->renderIdeaEnterpriseMembership('text')?><?php endif; ?></h5>
<img class="img-responsive-full lgi__img wp-post-image" src="<?php echo $e['imageLogoUrl']; ?>" alt="">
<div class="overlay"></div>
</div>
<div class="lgi__title stripe">
<h4><?php echo $e['title']; ?></h4>
<p><?php echo ysUtil::truncate($e['text_oneliner'], 85) ?></p>
</div>
</a>
</div>
<?php endforeach ?>
<?php else: ?>
<?php echo Notice::inline('Enterprises not found in this category or keyword') ?>
<?php endif; ?>
<!--end show single category with title-->
</div>
<!--end show category with title-->
<div class="row load_more_div">
<div class="col-sm-12 text-center">
<button type="button" class="btn btn-sd btn-sd-green full-width load-more-posts collapse please_wait_btn_class">
<h4 style="margin-top: 7px; color: #fff;">Loading...</h4>
</button>
<button type="button" class="btn btn-sd btn-sd-green full-width load-more-posts load_more_btn_class">
Load More <i class="icon-arr-down"></i>
</button>
</div>
</div>
</div>
JS :
$(document).on('click','.filter_button',function(e){
e.preventDefault();
var category = [];
$.each($("input[name='category[]']:checked"), function(){
window.location.replace('/idea/frontend/explore/category/'+$(this).val());
});
});
Appreciate if anyone could help me in this matter.
I have set up the modal for a team member page in WordPress as an advanced custom fields repeater field. That part works well, as it repeats and the modal opens up, but it only has the first team member's modal open up even though, it's another team member. My code is as follows:
<div class="leadership-row">
<?php
if ( get_field('leadership_block') ):
while( has_sub_field('leadership_block') ) :
?>
<div class="Leadership">
<a href="#teammember" rel="leanModal">
<div class="leadership-image">
<img src="<?php echo get_sub_field('leadership_image'); ?>" />
</div><!-- end of leadership-image -->
</a>
<div class="leadership-copy">
<h5 class="leadership-name"><?php echo get_sub_field('leadership_name'); ?></h5>
<h5 class="leadership-position"><?php echo get_sub_field('leadership_position'); ?></h5>
</div>
</div><!-- end of Leadership -->
<?php
endwhile;
endif;
?>
<?php
if ( get_field('team_modal') ):
while( has_sub_field('team_modal') ) :
?>
<div id="teammember">
<a class="modal_close"></a>
<div class="modal-image">
<img src="<?php echo get_sub_field('modal_image'); ?>" />
</div><!-- end of modal-image -->
<div class="modal-copy">
<h4><?php echo get_sub_field('modal_name'); ?></h4>
<p><?php echo get_sub_field('modal_position'); ?></p>
<img src="<?php echo get_sub_field('modal_icon'); ?>" />
<p><?php echo get_sub_field('modal_description'); ?></p>
</div><!-- end of modal-copy -->
</div><!-- end of teammember -->
<?php
endwhile;
endif;
?>
</div>
My JQuery is set up like this:
jQuery(document).ready(function($) {
$("a[rel*=leanModal]").leanModal({ top : 200, overlay : 0.4, closeButton: ".modal_close" });
});
Any help would be immensely appreciated.
I am having a problem in navigating from one page to another.
<?php
while($row = mysqli_fetch_array($result)) { ?>
<div class="list">
<p><?php echo $row['productname']?></p>
<div class="images">
<img src="<?php echo 'images/'. $row['image'] ?>" style="max-width:100%;height:auto;" />
</div>
}
<div class="text">
<p>
<?php echo $row['description'] ?>
</p>
</div>
<div class="clear"></div>
</div>
<?php
Here the problem is that when I click on the product link it does not take to the desired product description page. Rather than it is redirected to the same commodities page. So i am not understanding what to do.So please help me to find out my error..
You missed php tag inside your markup. please have a look updated code
<?php while ($row = mysqli_fetch_array($result)) { ?>
<div class="list">
<p><?php echo $row['productname']; ?></p>
<div class="images">
<img src="<?php echo 'images/' . $row['image']; ?>" style="max-width:100%;height:auto;" />
</div>
<!-- remove this end curly braces from ur markup-->
<div class="text">
<p>
<?php echo $row['description']; ?>
</p>
</div>
<div class="clear"></div>
</div>
<?php } ?>
<!-- close while loop in proper place. as of now $row['description'] outside from while loop -->
Syntax error in your php statements..
Echo statements are not terminated with (;)
<?php
while($row = mysqli_fetch_array($result)) { ?>
<div class="list">
<p><?php echo $row['productname']; ?></p>
<div class="images">
<img src="<?php echo 'images/'. $row['image']; ?>" style="max-width:100%;height:auto;" />
</div>
<div class="text">
<p>
<?php echo $row['description']; ?>
</p>
</div>
<div class="clear"></div>
</div>
<?php }?>
<?php