Skip to content

Instantly share code, notes, and snippets.

@f4rr3ll1990
Created June 24, 2017 22:31
Show Gist options
  • Save f4rr3ll1990/ead9a532005da4e4346fdfda641b917e to your computer and use it in GitHub Desktop.
Save f4rr3ll1990/ead9a532005da4e4346fdfda641b917e to your computer and use it in GitHub Desktop.
<?php
$idObj = get_category_by_slug('Имя Категории');
$id = $idObj->term_id;
if ( have_posts() ) : query_posts('cat=' . $id);
while (have_posts()) : the_post(); ?>
<?php echo get_post_meta($post->ID, 'Имя доп поля', true); ?>
<? endwhile; endif; wp_reset_query(); ?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment