Skip to content

Instantly share code, notes, and snippets.

@salehahmadbabu
Created December 30, 2017 09:00
Show Gist options
  • Save salehahmadbabu/99518142e0022f5ed8cd2bce4418827f to your computer and use it in GitHub Desktop.
Save salehahmadbabu/99518142e0022f5ed8cd2bce4418827f to your computer and use it in GitHub Desktop.
<?php get_header(); ?>
<?php
while ( have_posts() ) : the_post();
// checks neuron work meta is empty or not
if (get_post_meta( get_the_ID(), 'neuron_work_meta', true )) {
$work_meta = get_post_meta( get_the_ID(), 'neuron_work_meta', true );
} else {
$work_meta = array();
}
// get subtitle or set an empty value in it
if (array_key_exists('sub_title', $work_meta)) {
$sub_title = $work_meta['sub_title'];
}else {
$sub_title = '';
}
// get big preview or set an empty value in it
if (array_key_exists('big_preview', $work_meta)) {
$big_preview = $work_meta['big_preview'];
}else {
$big_preview = '';
}
// get link text or set an empty value in it
if (array_key_exists('link_text', $work_meta)) {
$link_text = $work_meta['link_text'];
}else {
$link_text = 'Visit Website';
}
// get link or set an empty value in it
if (array_key_exists('link', $work_meta)) {
$link = $work_meta['link'];
}else {
$link = '';
}
// get informations or set an empty value in it
if (array_key_exists('informations', $work_meta)) {
$informations = $work_meta['informations'];
}else {
$informations = '';
}
?>
<!-- ::::::::::::::::::::: Page Title Section:::::::::::::::::::::::::: -->
<section <?php if(has_post_thumbnail()) : ?> style="background-image: url(<?php the_post_thumbnail_url(); ?>);" <?php endif; ?> class="page-title">
<div class="container">
<div class="row">
<div class="col-md-12">
<!-- breadcrumb content -->
<div class="page-breadcrumbd">
<h2><?php the_title(); ?></h2>
<p><a href="<?php echo site_url(); ?>">Home</a> / <?php the_title(); ?></p>
</div><!-- end breadcrumb content -->
</div>
</div>
</div>
</section><!-- end breadcrumb -->
<section class="single-portfolio-wrapper section-padding">
<div class="container">
<div class="row">
<div class="col-md-8">
<!-- single portfolio images -->
<div class="single-portfolio-images">
<?php
// get the image link if preview image has set
$big_preview_img = wp_get_attachment_image_src( $big_preview, 'large' );
?>
<!-- checks the big preview image is set or not -->
<!-- if it is not set the post thumbnail -->
<?php if(!empty($big_preview)) :?>
<img class="img-responsive" src="<?php echo $big_preview_img[0]; ?>" alt="">
<?php else : echo the_post_thumbnail( 'large' ); endif; ?>
</div>
</div>
<div class="col-md-4">
<!-- single portfolio info -->
<div class="single-portfolio-inner">
<header class="single-portfolio-title">
<?php echo $sub_title; ?>
</header>
<div class="portfolio-details-panel">
<?php the_content(); ?>
<ul class="portfolio-meta">
<?php
// if $informations is empty then foreach loop won't run here
// otherwise it'll execute
if(!empty($informations)) : foreach($informations as $information) :
?>
<li><span> <?php echo $information['title']; ?> </span> <?php echo $information['value']; ?></li>
<?php endforeach; endif; ?>
<li><span> Share </span> <a href="#"><i class="fa fa-facebook"></i></a> <a href="#"><i class="fa fa-twitter"></i></a> <a href="#"><i class="fa fa-google-plus"></i></a> <a href="#"><i class="fa fa-pinterest"></i></a></li>
</ul>
</div>
<!-- checks link is empty or not -->
<?php if(!empty($link)) :?>
<a class="btn btn-primary" href="<?php echo $link; ?>"> <?php echo $link_text; ?> </a>
<?php endif; ?>
</div>
</div>
</div>
</div>
</section>
<?php endwhile; ?>
<?php get_footer(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment