For my Campus Project, I am developing a Travel based website where Touring Spots will be achieved and nearby Hospital, Shopping Mall and Hotel names will be listed on the following touring spots post.
Now What I am trying is to make a list of Hospital, Shopping Mall and Hotel based on specific category where category is the name of the Touring Spot.
I’ve tried a lot but now almost tired and looking for somebody’s kindly help.
Here’s what I’ve tried so far, please have a look and let me be succeeded by getting your precious co-operation.
// CAT FILTERING
$filtering = new WP_Query( array( ‘tag’ => ‘hospital’ ) , array( ‘category_name’ => ‘Dinajpur’ ) );
if ( $filtering->have_posts() ) :
<?php while ( $filtering->have_posts() ) : $filtering->the_post(); ?>
<li><a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a></li>
<?php endwhile; ?>
<?php else : ?>
<p><?php _e( ‘Sorry, no posts were found.’ ); ?></p>
<?php endif; ?>
<?php wp_reset_postdata(); ?>
Category Name is the Touring Spot
Tag will let us know if it’s Shopping Mall or Hospital or Hotel/Resort
If any touring post visited, a list will need to be shown based on that page’s categories available tagged item. e.g: Mall / Hotel / Hospital