Venture: Changing the size of the Featured Image in single views

By default, the theme displays a thumbnail in single views. This thumbnail (featured image) is generated automatically by WordPress. 

The maximum width of the featured image in single views is 1440px. The reason why there is a set maximum width is because some users upload images that have up to 5000px width, as a result it slows down the site.

It is possible to change this width to the original size by using a simple code snippet.

We are going to use the Code Snippets plugin for adding a custom snippet to our WordPress site. If you've not installed this plugin yet on your site, please do so. 

The reason why we are using this plugin is because it's highly not recommended to modify the parent theme files. You should use either a special plugin for it, or a child theme.

Once the plugin is installed and activated on your site, you should see the Snippets link in the main menu section in your Dashboard:

  1. Click on Add New to create a new code snippet.
  2. Add a title for your code snippet. For example, Size of the Featured Image in single views
  3. In the Code section, add the following code:
    function venture_custom_featured_image_size_single_view() { 	
      return 'full'; 
    add_filter( 'venture_single_thumbnail_size', 'venture_custom_featured_image_size_single_view' );
  4. Below the Code section, you can find a section of options that asks where you want to run your code snippet. In our case, we need to select "Only run on site front-end" option.
  5. Add description of your code snippet, so you know why the code has been added to your site and what it does (optional).
  6. Add tags (optional).
  7. Click "Save Changes" to save your code snippet.
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.