How to display pictures from database?

You’ll want to use wp_get_attachment_image_url() or wp_get_attachment_image(). You just pass them the ID of the image in the database and the size you want. wp_get_attachment_image_url() gives you the URL of the image: echo wp_get_attachment_image_url( $attachment_id, ‘large’ ); // http://example.com/wp-content/uploads/2017/01/image-1024×1024.jpg While wp_get_attachment_image() gives you a full image tag: echo wp_get_attachment_image( $attachment_id, ‘large’, false, [ ‘class’ => … Read more

displaying category and subject posts

I’m not sure if I get you right, but if so, this will solve your problem: <?php $classes = array(); $subjects = get_the_terms( get_the_ID(), ‘subject’ ); $categories = get_the_terms( get_the_ID(), ‘category’); if ( count($terms) > 1 ) { $classes[] = “reset”; } else { foreach ($subjects as $term ) { $classes[] = $term->slug; } } … Read more