WordPress.org

Ready to get started?Download WordPress

Forums

Pilcrow
Pilcrow Featured Image Size (2 posts)

  1. alphaace
    Member
    Posted 6 months ago #

    Hi,

    I am using the Pilcrow theme and am new to wordpress but have some experience with php.

    The 770 width is too narrow so I went in to the editor and changed styles.css to 800. However, that caused my featured images not to go to across the entire 800 pixels (they were still at 770 but the black lines bordering it extended farther out).

    I then went in and tried changing:
    '$args['width'] = apply_filters( 'pilcrow_header_image_width', 770);' in custom-header.php but then all the my featured images change to just the default header image (the books).

    How do I set wider featured images? Thank you so much for your help!

    Kind regards,
    Greg

  2. If you change the default featured-image width you'll also need to regenerate thumbnails, using a plugin like this:

    http://wordpress.org/plugins/regenerate-thumbnails/

    That forces images at the new 800px size to be created for any existing posts with a featured image. (The original image will need to be at least 800px for this to work. Smaller images won't be "upsized.")

    But before you do that, let's go back a bit. I strongly recommend that you not edit the original theme files directly. The reason is that if you do that, the moment you update the theme when a new version comes out, you'll need to redo all your changes, as they'll be overwritten and lost.

    Instead, I recommend that you make a child theme, so your tweaks won't be overwritten when updating the theme. Here are some guides in case you haven't made one before:

    http://codex.wordpress.org/Child_Themes
    http://op111.net/53/
    http://vimeo.com/49770088

    Once your child theme folder is set up, add your CSS changes you did earlier to the style.css file that's within the child theme folder.

    Next, create an empty, plain-text file called functions.php and place it in the child theme folder. Copy this code into the file:

    <?php
    function childtheme_header_image_width() {
    return 800; /* height in px */
    }
    add_filter( 'pilcrow_header_image_width', 'childtheme_header_image_width' );
    ?>

    This will override the 770px height for featured images used as custom headers.

    After you do that, regenerate your thumbnails using the plugin I mentioned above.

    Let me know how it goes.

Reply

You must log in to post.

About this Theme

About this Topic