<?php
get_header();
echo '<br>';
?>
<?php
echo 'CATEGORY.PHP';
?>
<h2>Tytul kategorii: <?php single_cat_title(); ?></h2>
<span>Opis kategorii: <?php echo category_description(); ?></span>
<?php
$cat_slug = str_replace(" ", '-', single_cat_title("", false));
?>
<?php
$loop = new WP_Query(array( // petla z zawezonym wyszukiwaniem
'post_type' => 'post',
'category_name' => $cat_slug
));
while($loop -> have_posts()) : $loop -> the_post();
?>
<a href="<?php the_permalink(); ?>"><h2><?php the_title(); ?></h2></a>
<p><?php the_content(); ?></p>
<?php endwhile; ?>
<?php
echo '<br>';
get_footer();
?>
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.