• My featured image option no longer works. It allows me to select a picture, gives no error messages, and then returns to the post without the thumbnail. How can I get this resolved?

    *Side note: I initially resolved this problem by reverting to an earlier version of the site (4.5.1) as at the time I also had several problems with loading pictures to a gallery or a slideshow. (the options for these were either incomplete or missing) With the recent update the gallery option seems to work fine but the featured image is still kaput.

    The post in question is: Black Forest

Viewing 4 replies - 1 through 4 (of 4 total)
  • Based on the link above, I’m not seeing an broken images and looks like the featured image is showing on the link as expected? Were you able to resolve the issue?

    Thread Starter happywinke

    (@happywinke)

    I’ve inserted a piece of code I found that instructs the site to pull the first photo. The problem is still present… The Featured Photo does not grab the media file. Do you need me to remove the above code so you can see it?

    *Correction to original post. I fixed the slideshow by manually putting in gallery=slideshow for every post, do I need to do something like that for featured post.

    Thread Starter happywinke

    (@happywinke)

    I added this to the function php?

    [ Moderator note: code fixed. Please wrap code in the backtick character or use the code button. ]

    //function to call first uploaded image in functions file
    function main_image() {
    $files = get_children('post_parent='.get_the_ID().'&post_type=attachment
    &post_mime_type=image&order=desc');
      if($files) :
        $keys = array_reverse(array_keys($files));
        $j=0;
        $num = $keys[$j];
        $image=wp_get_attachment_image($num, 'large', true);
        $imagepieces = explode('"', $image);
        $imagepath = $imagepieces[1];
        $main=wp_get_attachment_url($num);
    		$template=get_template_directory();
    		$the_title=get_the_title();
        print "<img src='$main' alt='$the_title' class='frame' />";
      endif;
    }

    Thread Starter happywinke

    (@happywinke)

    and this to the post format function;

    <?php if (  (function_exists('has_post_thumbnail')) && (has_post_thumbnail())  ) {
      echo get_the_post_thumbnail($post->ID);
    } else {
       echo main_image();
    } ?>

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Featured Post is malfunctioning’ is closed to new replies.