Calling specific category to front page
-
I am trying to call a specific category post to my front page including the feature image (which becomes the background image in the section) and title. Below are the snippets but for some reason nothing is showing up. Any tips would be appreciated.
Here is the link to my website
https://www.johannesterry.ca/joie/
<!-- FEATURE BLOGS --> <?php $feature_posts = array_reverse(get_posts(array( 'posts_per_page' => 3, 'offset' => 0, 'category_name' => 'feature-posts'))); ?> <?php foreach($feature_posts as $feature_post): ?> <?php $post_custom_fields = get_post_meta($feature_post->ID); ?> <div id="info-box-sect" class="info-box-sect"> <div class="expanded row"> <!-- BOXES REPEAT --> <div class="medium-4 columns box" style="background: linear-gradient( rgba(109, 30, 42, 0.4), rgba(109, 30, 42, 0.4) ), url('<?php echo $image[0]; ?>'); background-size: cover;"> <span class="joie-category"><?php echo $post_custom_fields['main_category'][0];?></span> <div class="medium-9 outside-box"> <div class="inside-box blg-title"> <h4><?php echo $feature_posts->post_title; ?></h4> </div> </div> </div><!-- BOXES END --> <?php endforeach; ?> </div> </div>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Calling specific category to front page’ is closed to new replies.