Page featured image not showing on home page

I think you’d need to get the actual page object and find the ID from there. Then, you can pass that ID to the_post_thumbnail(), otherwise I think the ID of a post in the loop will be used, not the actual home page. Try this $page_object = get_queried_object(); to get info about your home page.

Thumbnail size according to width and height

add_image_size doesn’t do what you think it does. It doesn’t add an image of size X to a thumbnail, rather it registers an image size, and its associated dimensions. register_image_size may well have been the more appropriate name for this function. As a result, you need to register all your image sizes, on every page … Read more

Setting featured image based on related post

I took a quick look at the Modern Tribe’s source code, particularly the single-event.php view template. MT is using an internal function, tribe_event_featured_image(), which includes a filter: tribe_event_featured_image. You could use this filter to see if MT has already found an image, and, if not, look up your own and return its value. add_filter( ‘tribe_event_featured_image’, … Read more

Featured image not showing on page

From the url you supplied it looks like you are using a custom post type of blog. The most likely reasons you are not seeing the post you want to display is that by default WP_Query is only set to display posts – see WordPress Codex on WP_Query Post & Page Parameters for more info. … Read more

News and Featured image

Some of the code you have in here is really outdated and has been deprecated for quite some time. I am going to use updated code so that it’s more useful to those who will stumble on this thread. <div class=”news_item”> <?php $posts = get_posts( ‘numberposts=2&order=DESC&orderby=post_title&category_name=news’ ); foreach ( $posts as $post ) : setup_postdata($post); … Read more

if statement for featured images

The second if statement requires it to be a post, so a 404 page won’t pass. I’d re-do it like this, using elseif statements. I also changed $thumbnail->ID to $post->ID since the former was not defined. add_action( ‘genesis_before_header’, ‘minimum_featured_image’ ); function minimum_featured_image() { global $post; if ( is_home() ) { echo ‘<div id=”featured-image-home”>’; echo get_the_post_thumbnail($post->ID, … Read more

Url link to feature image in the portfolio [closed]

I think it is possible with custom fields. Add a custom fields, for example, named link. Put the link into the value field. Then you will be able to access it something like that: <a href=”https://wordpress.stackexchange.com/questions/187970/<?php echo get_post_meta( get_the_ID(),”link’, true ); ?>”> <?php the_post_thumbnail(); ?> </a>