post-featured-image (width="100%" height="100%")
-
<figure class=”post-featured-image”><img width=”720″ height=”300″ src=”http://demo.themegrill.com/accelerate/wp-content/uploads/sites/6/2014/05/office-341531_1280-720×300.jpg” class=”attachment-featured-blog-large wp-post-image” alt=”Spectacle and A Pen” title=”Spectacle and A Pen”></figure>
1 Tell me how to make that image was the whole width 100%?
2 Tell me how to make that image is displayed when viewing the post?
-
The first question I have decided! 🙂
figure img { width: 100%; }The second question, I do not know how to solve. Tell me what to do so that thumbnail images are displayed when viewing the post?
The answer to the second question <?php the_post_thumbnail(‘full’); ?>
/wp-content/themes/accelerate/content-single.php:
<?php /** * The template used for displaying page content in page.php * * @package ThemeGrill * @subpackage Accelerate * @since Accelerate 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php do_action( 'accelerate_before_post_content' ); ?> <div id="post-header-image-v1" style="margin-bottom: -62px;"> <?php the_post_thumbnail('full'); ?> </div> <div id="post-header-text-v1" style="background: rgba(255, 255, 255, 1); padding: 14px 0px 0px 0px; box-shadow: 0px -3px 0px 0px rgba(119, 204, 109, 0.78); position: relative;"> <header class="entry-header"> <h1 class="entry-title"> <?php the_title(); ?> </h1> </header> <?php accelerate_entry_meta(); ?> </div> <div class="entry-content clearfix"> <?php the_content(); wp_link_pages( array( 'before' => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'accelerate' ), 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div> <?php do_action( 'accelerate_after_post_content' ); ?> </article>There styles are spelled wrong.
Here is the code without the styles:
/wp-content/themes/accelerate/content-single.php<?php /** * The template used for displaying page content in page.php * * @package ThemeGrill * @subpackage Accelerate * @since Accelerate 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php do_action( 'accelerate_before_post_content' ); ?> <div id="post-header-image-v1" style=""> <?php the_post_thumbnail('full'); ?> </div> <div id="post-header-text-v1" style=""> <header class="entry-header"> <h1 class="entry-title"> <?php the_title(); ?> </h1> </header> <?php accelerate_entry_meta(); ?> </div> <div class="entry-content clearfix"> <?php the_content(); wp_link_pages( array( 'before' => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'accelerate' ), 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div> <?php do_action( 'accelerate_after_post_content' ); ?> </article>/wp-content/themes/accelerate/content-single.php
Please add the possibility to enable or disable the thumbnail in the posts.
Because when you update the theme code flies. And you need to register it again<?php /** * The template used for displaying page content in page.php * * @package ThemeGrill * @subpackage Accelerate * @since Accelerate 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php do_action( 'accelerate_before_post_content' ); ?> <div id="post-header-image-v1" style=""> <?php the_post_thumbnail('full'); ?> </div> <div id="post-header-text-v1" style=""> <header class="entry-header"> <h1 class="entry-title"> <?php the_title(); ?> </h1> </header> <?php accelerate_entry_meta(); ?> </div>I added the new code. To a social message is displayed picture.
/wp-content/themes/accelerate/content-single.php
<?php /** * The template used for displaying page content in page.php * * @package ThemeGrill * @subpackage Accelerate * @since Accelerate 1.0 */ ?> <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <?php do_action( 'accelerate_before_post_content' ); ?> <meta property="og:image" content='<?php the_post_thumbnail('full'); ?>'/> <meta itemprop="image" content='<?php the_post_thumbnail('full'); ?>'/> <meta name="twitter:image:src" content='<?php the_post_thumbnail('full'); ?>'/> <link rel="image_src" href='<?php the_post_thumbnail('full'); ?>'/> <div id="post-header-image-v1" style=""> <?php the_post_thumbnail('full'); ?> </div> <div id="post-header-text-v1" style=""> <header class="entry-header"> <h1 class="entry-title"> <?php the_title(); ?> </h1> </header> <?php accelerate_entry_meta(); ?> <div class="entry-content clearfix"> <?php the_content(); wp_link_pages( array( 'before' => '<div style="clear: both;"></div><div class="pagination clearfix">'.__( 'Pages:', 'accelerate' ), 'after' => '</div>', 'link_before' => '<span>', 'link_after' => '</span>' ) ); ?> </div> <?php do_action( 'accelerate_after_post_content' ); ?> </article>Accelerate 1.0.9 (Last Updated: 2014-11-05):
Tell me how to make that image was the whole width 100% and height 100%;?
This code used to work, but now stopped:
figure img { width: 100%; }Now when loading images in thumbnail substituted link (-720×300.jpg)
<figure class="post-featured-image"> <a href="http://mysite.com/kakoj-noutbuk-kupit-dlya-raboty/" title="Какой ноутбук купить для работы"> <img width="720" height="300" src="http://mysite.com/wp-content/uploads/Kakoy-noutbuk-kupit-dlya-raboty-720x300.jpg" class="attachment-featured-blog-large wp-post-image" alt="Какой ноутбук купить для работы" title="Какой ноутбук купить для работы"> </a> </figure>I found!
1. We need to open the file: functions.php
2. Change this code:
add_image_size( 'featured-blog-large', 720, 300, true );
on this code:
add_image_size( 'featured-blog-large', 720, 500, true );3. Delete the downloaded image of WordPress. Delete the admin panel.
4. Upload image again. And it will be clipped with a new size 720×500.jpg
Hey Vadim V.
You save my life with the code to display featured image when viewing the post (without the styles).
Thank you so much for your help!Welcome! 🙂
Hello…do you know how can i put my homepage exactly as the one showed on Themegrill Accelerate “Live Demo” website?
I mean…with that 3 images underneath the slider?
Thanks in advance
The topic ‘post-featured-image (width="100%" height="100%")’ is closed to new replies.
