if ( ! empty( $terms ) && ! is_wp_error( $terms ) ){
foreach ( $terms as $term ) {
$icon = pods_field( 'services_tax', $term->term_id, 'images', true );
$icon_url = $icon['guid'];
$icon_thumb = pods_image_url ( $icon_url, 'large', 0, false ) ;
$term_link = get_term_link($term);
?>
<div class="services-item">
<a href="<?php echo $term_link;?>">
<img src="<?php echo $icon_thumb; ?>" alt="">
</a>
</div>
<?php
}
}
Notice: Trying to get property of non-object in
add_action('init', 'master_post');
function master_post(){
register_post_type('master', array(
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'show_in_menu' => true,
'query_var' => true,
'rewrite' => true,
'capability_type' => 'post',
'has_archive' => false,
'hierarchical' => false,
'taxonomies' => array('post_tag' , 'master_tag'),
'menu_position' => null,
'supports' => array('title','editor','author','thumbnail','excerpt')
) );
}<?php
$tags = get_terms( array(
'taxonomy' => array( 'master_tag' ), // название таксономии с WP 4.5
) );
foreach( $tags as $tag ):
$posts = get_posts(array(
'numberposts' => 1000,
'orderby' => 'date',
'order' => 'DESC',
'post_type' => 'masters',
) )
?>
<h2> <?= $tag->name; ?> </h2>
<?php
foreach( $posts as $post ):
setup_postdata( $post );
?>
<article>
<h3> <?php the_title(); ?> </h3>
......
</article>
<?php
endforeach;
wp_reset_postdata();
endforeach;
?>
и это не работает, без ошибок. Просто пустой вывод.
Второй вариант вылетает с ошибкой
198 строка это конец документа, а данный код на другой строке.