• Resolved maggieobrien

    (@maggieobrien)


    I inherited a client’s WordPress website project with a custom theme. I’m running into an issue on their blog posts page.

    Previous posts (August 15th, 2018 and prior) successfully post on the blog page with a feature image. Making a duplicate of these successful posts the feature image will not show on the blog page. Even creating a brand new blog post doesn’t pull the feature image through. The only way I was able to get it to show on the page was by including the media in the actual body of the post. This is of course, not the solution since it shows in the post.

    Any suggestions?

Viewing 4 replies - 1 through 4 (of 4 total)
  • If the custom theme doesn’t do it “the WordPress way”, you’ll have these issues.
    The WordPress way would be for the theme to use add_theme_support('post-thumbnails')
    https://developer.wordpress.org/reference/functions/add_theme_support/#post-thumbnails
    and then output them with one of the functions for that.

    If it’s older code, it’s likely that they used post meta (custom fields) to hold the featured image, which means it’s not available through the WP functions.
    You’d have to read some theme code to see what its doing, and perhaps update it to do it the more compatible way.

    Thread Starter maggieobrien

    (@maggieobrien)

    Hi @joyously

    Thank you SO much for getting back to me about this. I’m going a little bonkers.

    I took a look at the link you sent and it looks like the site is doing it “the WordPress way”. In the functions.php file here’s what I have:

    add_theme_support( 'post-thumbnails' );
    add_image_size('indibiz_post_thumbnail_loop', 700, 380, true);

    I checked the template the blog page is using:

    <div class="row">
    			<div class="col-md-12">
    
    				<div id="primary" class="content-area">
    
    					<main id="main" class="site-main" role="main">
    
    						<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    
    							<?php get_template_part( 'content', 'page' ); ?>
    							<?php endwhile; // end of the loop. ?>
    						<?php endif; ?>
    
    					</main><!-- #main -->
    
    				</div><!-- #primary -->
    
    			</div><!-- col-md-8 -->
    
    		</div><!-- row -->

    I also checked what was on the blog page, here’s the page text:

    [posts-for-page cat_slug='companyname-blog' hide_images='false' num='20' read_more='
    Read More »' show_full_posts='false' use_wp_excerpt='true' strip_html='true' hide_post_content='false' show_meta='true']

    Is there somewhere else I should be checking? I’m still baffled that some of the featured images are pulling through on the blog page and more recent posts are not…

    • This reply was modified 7 years, 1 month ago by maggieobrien.

    What you say is on the blog page is a shortcode. For themes in the WordPress repository, shortcodes are not allowed, but other themes may provide them. It’s really a plugin sort of thing. So I can’t tell from here whether it’s a theme or plugin shortcode, but it’s a list of posts generated by some other code that is not in the theme template files.

    Thread Starter maggieobrien

    (@maggieobrien)

    @joyously thank you! Yes, I just found that it’s using a plugin called Posts for Page. It’s out-dated and others have reported issues. Thank you for your help!

    https://wordpress.org/support/plugin/posts-for-page/

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Feature Image on Posts Sometimes Working’ is closed to new replies.