Tonal – Featured Image in image post not showing…

  • Unknown's avatar

    Help!

    http://track59.wordpress.com

    1. Featured images do not seem to work on anything but standard posts. Is this the expected behavior? I don’t think that it is, since they seem to appear on the theme demo site for various post types (as evidenced by the little icon on the right side).

    I know that the behavior of featured images depends on the theme, but is there documentation of the theme features somewhere?

    2. Speaking of the little icon on the right side, the theme demo site shows several posts that include more than one post type. However, the post editor does not seem to allow more than one selection of post format type (which sort of makes sense). Refer to this page: http://theme.wordpress.com/themes/tonal/ – note that the pictures show two icons on the right side. I did notice that the actual demo does not show two icons on any post.

    Thanks!

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Hi there,

    I’m still looking at the theme’s source code to see how to answer #1, but for #2:

    Speaking of the little icon on the right side, the theme demo site shows several posts that include more than one post type.

    The second icon is actually the comment icon, which links to the specific post’s comment area. So, not a post format, and you are correct that there can only be one format for any given post.

  • Unknown's avatar

    For #1, this is the source code for displaying the featured image (you can skip to the explanation after it);

    <?php if ( '' != get_the_post_thumbnail() && '' == $format ) : ?>
    		<div class="entry-thumbnail">
    			<a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'tonal' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="<?php the_ID(); ?>">
    				<?php the_post_thumbnail( 'featured-image' ); ?>
    			</a>
    		</div><!-- .entry-thumbnail .fullwidth-block -->
    	<?php endif; ?>

    The important part is the first line. it says that if the post thumbnail is not empty (meaning that it exists), AND the post format is empty, then display the post.

    In WordPress parlance, empty post format refers to the “Standard” post format (reference: http://wordpress.stackexchange.com/questions/58121/why-is-get-post-format-for-standard-returns-empty).

    So, in essence, the theme will only display post thumbnail / featured images if there exists one in a post, and the post belong to the “Standard” post format. Any other formats will not display it.

    To answer your confusion about the demo site, only the Standard posts display featured images there. Image format posts actually display an image that is posted within the post, not as a featured image. Same thing with the Gallery format posts. Posts that belong to other formats do not have featured images set.

    Hope this helps!

  • Unknown's avatar

    Hafizr,

    Thanks so much for your thorough response!

    So, I took the image post and removed the featured image, inserted the image at the top of the post editor, and yes the image appears in the post now. However, it is the width of the post, not the full width of the container like the featured images are. In the demo, the image posts do display the full width of the container, just like featured images.

    Is there a method of inserting the image that will accomplish a full width display?

  • Unknown's avatar

    As far as I can tell, all the theme does is grab the first image and put it on the very top of the post. So, the sizing is only determined by the size setting you chose when adding the image to the post.

    Size setting can be seen here, number 7: http://en.support.wordpress.com/images/#upload-images-from-your-computer

    Here is the default size settings for images in WordPress:
    http://en.support.wordpress.com/settings/media-settings/#image-sizes

    As the full width of a post in the theme is 1024px, you will want to upload images that are at least 1024 pixels wide, and then choose the “Large” option on the Size setting above.

  • Unknown's avatar

    OK, I agree that images in image posts are not featured images. However, wordpress.com code for the first image is somewhat different than the demo. WordPress.com adds sizing to the <div> that is only 640 wide. The demo adds 1280. I believe that the demo version is probably wordpress.org. I have my image settings all set to full size, and the image in question was greater than 1024 pixels wie.

  • Unknown's avatar

    OK, I have figured something out, but I’m not sure what.

    If I insert an image into the image post at “large” size, then the following html is placed in my post.

    <img src=”http://track59.files.wordpress.com/2014/04/1280×582.jpg?w=640″ alt=”1280×582″ width=”640″ height=”291″ class=”aligncenter size-large wp-image-74″ />

    The resulting display is an image that is not full width. However, if I edit size-large to say size-full, and adjust the w=640 numbers to w=1024, then I get a full width image.

    When an image is inserted into the post using the full size selection, the the w=xxx expression is not added to the html. I believe that this may be a bug – in other words it is not the intended behavior. If it were to be inserted, then the expected behavior would occur.

  • Unknown's avatar

    Hi,

    You’re right, I tested on my site and the sizing behavior was buggy there as well. No idea why this happens, though.

    I think as for now your best solution is to hand edit the code as you did, since the automatic code insertion outputs the wrong code.

  • Unknown's avatar

    hafizr,

    Thanks for your help. I have reached the same conclusion, but at least I know what I am dealing with.

  • Unknown's avatar

    You’re welcome, glad to help.

  • Unknown's avatar

    Hello,

    Everyone. I’m not a developer so I need help with this one. I also got the same problem with the images. I want to set my images on text posts to be 850 px. The theme say I can fix whatever width I want but nothing happen. It’s only if I post an individual photo that I can use whatever size I want but I’m planning to use my theme for a blog so I want to write text posts and being able to post large images (multiple) to it. Any help on how I can easily do that?

    Many thanks for your help guys!

    Pia

  • The topic ‘Tonal – Featured Image in image post not showing…’ is closed to new replies.