Hello all!
We have a custom post type in my wordpress website under which we publish our reports. Here’s a sample report page -
http://www.marketresearchandstatistics.com/ad/lamea-learning-management-system-market/
See the report name. The report name has a specific format which is “Region” Report Topic “Market”
For each topic we have 5 regional variants, which are as follow:
- Global
- North America
- Europe
- Asia Paciic
- LAMEA
Our requirement is, when someone opens any one of the variant the other 4 should appear under the similar reports section. For that matter I used Contextual Related Posts plugin which is not able to meet the requirement 100% and in fact to the contrary making the site heavy. I was trying to figure out if there can be a way to achieve this with a custom code.
I found a code snippet but that shows similar posts as per the tags.
Here’s the code of the report page:
(h1 itemprop="headline" class="entry-title"><?php the_title(); ?> </h1)
<?php if (get_post_meta($post->ID, 'cc_price', true) !== '') { ?><span
class="price_meta">
<span class="price_left"></span><span class="price_center"><?php
if (cc_get_option('cc_currency') != '') {
echo cc_get_option('cc_currency');
} else {
echo get_option('currency_symbol');
}
echo get_post_meta($post->ID, 'cc_price', true);
?></span><span class="price_right"></span></span> <?php } ?>
<ul class="post_meta">
<li class="estimate"><?php echo get_post_meta($post->ID,'publish_date_new',true); ?><time class="dt-published" datetime="<?php echo get_post_meta($post->ID,'publish_date_new',true); ?>"></time></li>
<li class="cate"><?php printf(IN . ' ' . '%s', $taxonomies); ?></li>
<li itemprop="author" class="author p-author h-card">By <?php echo get_post_meta($post->ID,'published_by_new',true); ?>
</li>