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

redirect automatic page that serves custom posttype content

I solved my own question without breaking the url structure logic, as Krzysiek Dróżdż (thanks!) suggested. I changed the page named /page-actueel-blog to the custom-post-type ‘archive’ template. Pretty obvious, but I thought archive was something else entirely. For whoever may have the same doubts: the archive template is the level up from domain.com/blogpost (single-mycustomposttypename.php); a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)