Thumbnails for custom post not showing up in query

<div class=”col-md-4″> <article id=”post-<?php the_ID(); ?>” <?php post_class(); ?>> <header class=”page-header” style=”border-bottom:none; margin-bottom:0;”> <div style=”margin-bottom:5px;”> <a href=”https://wordpress.stackexchange.com/questions/125845/<?php the_permalink(); ?>” rel=”bookmark”> <?php if ( has_post_thumbnail() ) { the_post_thumbnail(‘col-6-thumb’); } ?> </a> </div> </header> <div class=”article-info”> <div class=”article-date”><h3><?php the_time(‘M jS’) ?></h3></div> <div class=”articletitle”><h3><a href=”https://wordpress.stackexchange.com/questions/125845/<?php the_permalink(); ?>” rel=”bookmark”><?php the_title(); ?></a></h3><p>by <?php the_author() ?></p></div> </div> </article><!– #post-## –> </div> … Read more

Black and White Thumbnail in WordPress Gallery

I think the best way to do this would be to add a filter to when the content is pulled into the post/page: <?php add_filter( ‘the_content’, ‘add_bw_thumbnails’ ) ?> Or to when an image is inserted into the editor: add_filter( ‘post_thumbnail_html’, ‘add_bw_thumbnails’, 10 ); add_filter( ‘image_send_to_editor’, ‘add_bw_thumbnails’, 10 ); You then just have to write … Read more

Post Thumbnail on Single (if elseif else)

I tried to refactor the code in a preferred way, that’s all. Logically, it seems to work. What I did is: I preferred WP_Query() for such custom query, because experienced WordPress enthusiasts like it that way (We can learn more) I changed the hard-coding into WordPress way to get the theme directory, using get_template_directory_uri() And … Read more

How to display thumbnail if post is assigned one otherwise not

you just need to clean up the if statement: <?php if ( has_post_thumbnail() ) { ?> <div class=”col-md-3″> <?php the_post_thumbnail(); ?> </div> <?php } ?> here’s the whole bit cleaned up: <?php query_posts(‘posts_per_page=1’) ?> <?php while ( have_posts() ) : the_post(); ?> <div class=”jumbotron”> <?php if ( has_post_thumbnail(); { )?> <div class=”col-md-3″> <?php the_post_thumbnail(); ?> … Read more

featured post as div background

You’re code is not working as you have an echo within an echo, try this code (not tested) <?php echo ‘<div id = “circ” style=”background: url(‘.$src[0].’><ul><li><a href = “‘.the_permalink().'</a></li></ul></div>’; ?> If you’re echo’ing something and then you want to add php within that echo you need to break the echo by adding ‘. $variable .’

Combining Post Thumbnails With Nivo Slider

the_post_thumbnail() displays the featured image. get_the_post_thumbnail() retrieves it for use in code. Try something like this: <?php $featured_image = get_the_post_thumbnail( get_the_ID() ); $fi_src = $featured_image[‘src’]; $slider = get_the_post_thumbnail( get_the_ID(), ‘sliderimage’ ); $s_src = $slider[‘src’]; ?> <img src=”https://wordpress.stackexchange.com/questions/130312/<?php echo $fi_src; ?>” data-thumb=””<?php echo $s_src; ?> title=”” />

Overwriting a Shortcode

A child theme’s functions.php file is loaded before the parent theme’s, so the behavior you’re seeing is correct. Try adding your shortcode on a later action instead: function wpa_add_child_shortcodes(){ add_shortcode( ‘jo_customers_testimonials_slider’, ‘jo_customers_testimonials_slider_with_thumbnail’ ); } add_action( ‘after_setup_theme’, ‘wpa_add_child_shortcodes’ );

How do I get resized thumbnails?

Your example code is calling the full size image as you mention and resizing to the dimensions you feed into the array. I’ve answered this question before here, but the basic idea is that you’ll want to use add_image_size() in your functions.php to tell WordPress you’d like it to create a new image size when … Read more