Skip to content

Instantly share code, notes, and snippets.

@vivirenremoto
Created September 3, 2020 06:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vivirenremoto/3908c8cd7ab57dcaf2b836e85d5bd78f to your computer and use it in GitHub Desktop.
Save vivirenremoto/3908c8cd7ab57dcaf2b836e85d5bd78f to your computer and use it in GitHub Desktop.
services.php petcare
<!-- Services -->
<div class="container">
<div class="row">
<?php if ($petcare_option['Service-listing'] == "1") {?>
<!-- Display 3 services -->
<?php
$args = array(
'post_type' => 'Service',
'post_status' => 'publish',
'posts_per_page' => 4,
'orderby' => 'post_title',
'order' => 'ASC',
);
$loop = new WP_Query($args);
while ($loop->have_posts()): $loop->the_post();
?>
<div class="col-md-3 col3">
<a href="<?php if ($petcare_option['ext-service-link']) {echo $petcare_option['ext-service-link'];} else {the_permalink();}?>" class="roundal wow bounceInUp"><?php the_post_thumbnail();?></a>
<h3><?php the_title();?></h3>
<p><?php echo substr(get_the_excerpt(), 0, 150); ?>&hellip;</p>
<a href="<?php if ($petcare_option['ext-service-link']) {echo $petcare_option['ext-service-link'];} else {the_permalink();}?>" class="btn btn-default btn-green"><?php echo $petcare_option['ext-service-button'] ? $petcare_option['ext-service-button'] : $petcare_option['Button-text']; ?></a>
</div>
<?php endwhile;?>
<?php } elseif ($petcare_option['Service-listing'] == "2") {?>
<!-- Display 6 services -->
<?php
$args = array(
'post_type' => 'Service',
'post_status' => 'publish',
'posts_per_page' => 6,
);
$loop = new WP_Query($args);
while ($loop->have_posts()): $loop->the_post();
?>
<div class="col-md-4 col3">
<a href="<?php if ($petcare_option['ext-service-link']) {echo $petcare_option['ext-service-link'];} else {the_permalink();}?>" title="<?php the_title();?>" title="<?php the_title();?>" class="roundal wow rollIn"><?php the_post_thumbnail();?></a>
<h3><?php the_title();?></h3>
<p><?php echo substr(get_the_excerpt(), 0, 150); ?>&hellip;</p>
<a href="<?php if ($petcare_option['ext-service-link']) {echo $petcare_option['ext-service-link'];} else {the_permalink();}?>" class="btn btn-default btn-green"><?php echo $petcare_option['Button-text']; ?></a>
</div>
<?php endwhile;?>
<?php } elseif ($petcare_option['Service-listing'] == "3") {?>
<!-- Display 9 services -->
<?php
$args = array(
'post_type' => 'Service',
'post_status' => 'publish',
'posts_per_page' => 9,
);
$loop = new WP_Query($args);
while ($loop->have_posts()): $loop->the_post();
?>
<div class="col-md-4 col3">
<a href="<?php if ($petcare_option['ext-service-link']) {echo $petcare_option['ext-service-link'];} else {the_permalink();}?>" title="<?php the_title();?>" title="<?php the_title();?>" class="roundal wow bounceInUp"><?php the_post_thumbnail();?></a>
<h3><?php the_title();?></h3>
<p><?php echo substr(get_the_excerpt(), 0, 150); ?>&hellip;</p>
<a href="<?php if ($petcare_option['ext-service-link']) {echo $petcare_option['ext-service-link'];} else {the_permalink();}?>" class="btn btn-default btn-green"><?php echo $petcare_option['Button-text']; ?></a>
</div>
<?php endwhile;?>
<?php }?>
</div>
</div>
<!-- Services end -->
<br><br><br><br>
<div class="container">
<?php
// opiniones google my business
echo do_shortcode('[reviews_rating]');
?>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment