• I’m having issues with the blog on my website. http://www.dragonfood.us/blog

    Everything looks well on what I suppose is the “loop” page but on single post, The image, title, nor date posted appears.

    Now the code for it in both pages is identical…

    <div class="blogimage" style="overflow:hidden;">
    "><img src="<?= get_featured_image(); ?>" alt="<?php the_title(); ?>" />
    </div>
    <div class="blogheader">
    "><div class="blogtitle"><?php the_title(); ?></div>
    <div class="blogdate"><?php the_date();?></span> | <?php the_author();?></div>
    </div>

    Since I’m just the designer and not a coder, the person who coded the site has been sorta MIA so I’m not really sure who to ask, I understand basic code but I hope some of you might be able to help me with this issue.

    Thank you for reading!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Have you looked for theme options that control the display on single pages?

    Because this is a custom theme, it will be nearly impossible to provide an exact answer to your question – we can’t see the code or any theme options.

    Thread Starter Mori

    (@klayde)

    I didn’t look in function themes but now that I see it I found this:

    if(empty($first_img)){ //Defines a default image
        $first_img = "/wp-content/themes/dragonfood/images/default.jpg";
      }
      return $first_img;
    }
    
    function get_featured_image() {
    	if (has_post_thumbnail( $post->ID ) ) {
    		$image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
    		return $image[0];
    	} else {
    		return "/wp-content/themes/dragonfood/images/default.jpg";
    	}
    }

    Which from reading it I’m guessing I have to replace…

    $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );

    But no idea what x_x

    I don’t think you need to change the code. I think you just need to assign the image as the ‘Featured Image’ for your post.

    Thread Starter Mori

    (@klayde)

    I did, the one you see on the blog itself is the feature image… That’s the issue, it appears on the regular blog page but not in the single post page :\

    OK. I suspect that the change needs to be made as an option for your theme, or if none exists, in single.php.

    Please check any theme options first, and if you can’t find anything there, put the code for single.php in a pastebin and post a link to it here.

    Thread Starter Mori

    (@klayde)

    Yeah the theme has no options, it is custom made.

    Here’s the link to single.php

    Thank you for helping me!

    I am sorry, but I don’t see anything that looks wrong! It might take someone logging in as an admin to debug the code.

    You can post a job request at jobs.wordpress.net to ask for help.

    Thread Starter Mori

    (@klayde)

    I see. Thank you for your help anyways.

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

The topic ‘Blog Page =/= Single Page Post’ is closed to new replies.