Query custom post type and showing its content

You are not closing the second while loop. You’ll probably want something like this: <?php /* * Template Name: Testimonials */ ?> <?php get_header(); ?> <div class=”container”> <div class=”content-page”> <h1><?php wp_title(); ?></h1> <title><?php wp_title(); ?></title> <?php $query = new WP_Query( array(‘post_type’ => ‘testimonials’, ‘posts_per_page’ => 5 ) ); while ( $query->have_posts() ) : $query->the_post(); ?> … Read more

Change theme’s thumbnail to cropped WP featured image

Check out get_the_post_thumbnail() $image_thumb = get_the_post_thumbnail( get_the_ID(), ‘thumbnail’); Here’s a more specific example: while (have_posts()) : the_post(); echo ‘<article class=”search-entry clearfix”>’; $image_thumb = get_the_post_thumbnail( get_the_ID(), ‘thumbnail’); echo ( $image_thumb ) ? sprintf(‘<a href=”https://wordpress.stackexchange.com/questions/168885/%s” title=”https://wordpress.stackexchange.com/questions/168885/%s” class=”search-portfolio-thumb”>%s</a>’, get_permalink(), get_the_title(), $image_thumb) : ”;

Background image not showing up

You did not create your header.php properly. You did not include HTML doctype declaration and head section. So here is your header.php <!doctype html> <html <?php language_attributes(); ?> class=”no-js”> <head> <meta charset=”<?php bloginfo(‘charset’); ?>”> <title><?php wp_title(”); ?><?php if(wp_title(”, false)) { echo ‘ : ‘; } ?><?php bloginfo(‘name’); ?></title> <meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″> <meta name=”description” content=”<?php bloginfo(‘description’); … Read more