WordPress.org

Ready to get started?Download WordPress

Forums

[Theme: Twenty Twelve] Change featured images size above 624px ? (5 posts)

  1. cupshaker
    Member
    Posted 1 year ago #

    Hi,
    (fresh noob here.)

    I'd like to change the size of the normal post's feature image above 624px. To make the image fit the entire site's width (960px max, like the default theme's setup).

    So far, I've been successfully trying to reduce the witdh under 624px. To do so, I've been messing with the function.php at line 74 where I've changed the following line...

    set_post_thumbnail_size( 624, 9999 ); // Unlimited height, soft crop

    But it doen't seem to work when I change the width to 960.

    Thanks for your help if you have any clue.

  2. fd1976
    Member
    Posted 1 year ago #

    Hi cupshaker

    Did you anywhere with this issue? Am I having the same problem and have tried a few things without much luck.

    Hope you figured out and can help with a solution.

    Thanks

  3. ricoh
    Member
    Posted 1 year ago #

    In content.php you can set the image size like so. (around line 17)

    <header class="entry-header">
    <?php the_post_thumbnail("960"); ?>

    The only caveat is that you would have to modify the site-content class width in style.css to see the image span to 960

    .site-content {
       width: 100%
    }

    I would add a class in page.php so you can target this specifically on the pages that you want this layout to be done since this change would bump down any navigation that is on the right hand side and would be applied to every page that implements this style.

    get_header(); ?>
    
    	<div id="primary" class="site-content new-class">
    		<div id="content" role="main">

    Maybe someone has a better way, this was off the top of my head.

  4. michaelphilip
    Member
    Posted 1 year ago #

    In style.php find header-image then add
    (width:100%).

    See below sample;

    .header-image {
    margin-top: 24px;
    margin-top: 1.714285714rem;
    width: 100%;
    }

  5. esmi
    Forum Moderator
    Posted 1 year ago #

    No! Do not edit the Twenty Twelve theme. It is the current default WordPress theme and having access to an original, unedited, copy of the theme is vital in many situations. First create a child theme for your changes.

Topic Closed

This topic has been closed to new replies.

About this Topic