PHP Classes

File: parts/podcast_category_highlight.php

Recommend this page to a friend!
  Classes of Victor Andeloci   One WordPress Game Theme   parts/podcast_category_highlight.php   Download  
File: parts/podcast_category_highlight.php
Role: Example script
Content type: text/plain
Description: Example script
Class: One WordPress Game Theme
WordPress theme for a gaming blog and podcast
Author: By
Last change:
Date: 1 year ago
Size: 1,007 bytes
 

Contents

Class file image Download
<?php
    $category
= get_category_by_slug('rpg');
?>

<section id="podcast_category_highlight">
    <div class="container">
        <h2 class="subtitle"><?= $category->name ?></h2>
        <?php if (!empty($category->description)) : ?>
<p class="category-description"><?= $category->description ?></p>
        <?php endif; ?>
<div class="pch-list podcast-items">
            <?php
                $args
= [
                   
'post_type' => 'post',
                   
'category_name' => $category->slug,
                   
'order' => 'ASC',
                   
'posts_per_page' => -1
               
];

               
wp_reset_query();
               
$query = new WP_Query($args);

                if (
$query->have_posts()) {
                    while (
$query->have_posts()) {
                       
$query->the_post();
                       
get_template_part('elements/podcast_item');
                    }
                }
           
?>
</div>
    </div>
</section>