If the_post_thumbnail(); is this – echo this text
If You need title from media use something like this: <?php $thumb = get_post(get_post_thumbnail_id()); echo $thumb->post_title;
If You need title from media use something like this: <?php $thumb = get_post(get_post_thumbnail_id()); echo $thumb->post_title;
The add_meta_box code you’ve posted does certainly register the metabox to the bottom of the side area. If the box is shown in the center then i imagine it’s because you’ve(at some point) moved the metabox, as can be done with any of the metaboxes(all drag and drop). WordPress remembers where you move boxes to, … Read more
Not sure I understand your question completely hakre but here is the code that shows the featured image for twenty-ten in header.php.The image sizing is defined in the functions.php file. It also uses a function called http://codex.wordpress.org/Function_Reference/get_header_image. <?php // Check if this is a post or page, if it has a thumbnail, and if it’s … Read more
To use this you will need to add this to in place of your themes thumbnail function: function your_thumbnail_caption($html, $post_id, $post_thumbnail_id, $size, $attr) { $attachment =& get_post($post_thumbnail_id); if ($attachment->post_excerpt || $attachment->post_content) { $html .= ‘<p class=”thumbcaption”>’; if ($attachment->post_excerpt) { $html .= ‘<span class=”captitle”>’.$attachment->post_excerpt.'</span> ‘; } $html .= $attachment->post_content.'</p>’; } return $html; } add_action(‘post_thumbnail_html’, ‘your_thumbnail_caption’, null, … Read more
You don’t need to do manual cropping; just create a custom image size, and WordPress will perform the cropping on image upload. e.g. in functions.php: add_image_size( ‘portfolio-thumbnail’, 214, 187, true ); Then in your portfolio template, inside the Loop: the_post_thumbnail( ‘portfolio-thumbnail’ ); (I assume you know how to handle the rest of the output, such … Read more
Something like this should work for your single.php template: <?php $next_post = get_adjacent_post( false,”,false ); if( isset($next_post->ID) ): $next_id = $next_post->ID; else: $next_post = new WP_Query( ‘posts_per_page=1&post_type=photo&order=ASC’ ); $next_id = $next_post->post->ID; endif; ?> <a href=”https://wordpress.stackexchange.com/questions/27977/<?php echo get_permalink( $next_id ); ?>”> <?php echo get_the_post_thumbnail( $next_id, ‘thumbnail’ ); ?> </a>
Query first set of posts (probably with get_posts(), unless you feel up to using WP_Query directly). Loop through it, display, save their IDs in some variable. Loop through them again, display thumbnails. Query second set of posts, excluding IDs saved earlier via post__not_in. Loop through it and display.
It’ stored in the post meta table as _thumbnail_id. The thumbnail is actually a “post” entry too, I think it’s stored as an “attachment” post type. So the _thumbnail_id meta value will be the ID which points to that attachment.
It’s hard to tell without seeing the theme files but I assume the one image is displaying because it is set as the “Post Thumbnail” or “Featured Image” on that particular post and that all other posts aren’t using that feature. The easy solution in that case would be to make sure you set any … Read more
No, its not. But you can set up a css rule like min-width:”400px” for the thumbnails