I have one custom post type 'team' to create and display team-members and all works fine (screenshot how it needs to look):
In admin panel user entries team member position into input field and attach featured image and publish post and all works fine.
but last item of the list of team member it's image with link "SEND CV" when all previous items it's image with team member position without any links. So I need to create another custom post type just for this one image with link or it's any way I can change last post to have link instead of position?
Here is my query:
<?php
$query = new WP_Query(array(
'post_type' => array('team'),
'orderby' => 'menu_order',
'order' => 'ASC',
));
if ($query->have_posts()) {
while ($query->have_posts()) {
$query->the_post(); ?>
<li class="col-lg-3 d-flex text-center">
<div class="team-member-wrapper text-center mx-auto">
<div class="img-border">
<?php
the_post_thumbnail('full', array('class' => 'team-member-img img-fluid'));
?>
</div>
<?php
echo '<span class="team-member-position">' . get_post_meta(get_the_ID(), 'position', true) . '</span>';
?>
</div>
</li>
<?php
}
} else {
}
wp_reset_query();
wp_reset_postdata(); ?>
if (lastElement) { ...
. edit your question to show how you generate the others entries.anchor
instead ofspan
which I have.