Showing featured image of page’s child’s children page

I created a solution through trial and error, unfortunately having to resort to custom fields. I added a custom field to every child element i wanted to display and used the code: <?php $args = array( ‘post_type’ => ‘page’, ‘meta_key’ => ‘xxxx’, ‘meta_value’ => ‘xxxx’ ); $myPages = new WP_Query($args); while ($myPages->have_posts()) : $myPages->the_post(); echo … Read more

Basic PHP question (displaying post title over thumbnail) [closed]

You don’t need php at all to achieve what you are after. This can be done with just css. This shows the title and excerpt by default. .wrap .wp-tiles-byline-fade-in .wp-tiles-tile-with-image .wp-tiles-byline { opacity: 1; } This hides the excerpt again now that we have revealed it. .wrap .wp-tiles-byline-fade-in .wp-tiles-tile-with-image .wp-tiles-byline .wp-tiles-byline-content { opacity: 0; } … Read more

IF statement to filter featured image article

If i understood you correctly, you want the featured image to be displayed or not based on whether it was uploaded or not. If so, the basic code is: <?php if( has_post_thumbnail() ) { ?> <a href=<?php the_permalink(); ?>”><img src=”https://wordpress.stackexchange.com/questions/231934/<?php the_post_thumbnail(); ?>” title=”<?php the_title(); ?>” /></a> <?php } ?> And that displays the image linking … Read more

Featured image doesn’t appear in Blog index

Managed to find an alternative function that correctly calls the featured image set for the Blog index page by using this: <?php get_header(); ?> <?php if ( is_home() && get_option(‘page_for_posts’) ) { echo get_the_post_thumbnail_url( get_option(‘page_for_posts’) ); } ?> Thanks to those for your help