Support » Theme: Blocksy » Custom ratio of post image in blog/archive

  • Resolved aljesco

    (@aljesco)


    Hello,

    Can you please tell me if it’s possible to change the default 4:3 ratio of post image (when browsing home page / archive) to the square one (1:1) somehow?

    I found that there is an option to do this for woocommerce archives https://wordpress.org/support/topic/adding-image-sizes/
    But I need this for regular (non-woocommerce) post archives.

    Thanks in advance!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter aljesco

    (@aljesco)

    Okay I found a quick dirty hack to make all image previews square:

    if (! function_exists('blocksy_generate_ratio')) {
    	function blocksy_generate_ratio($ratio, $attachment_id = null) {
    		return '<span class="ct-ratio" style="padding-bottom: 100%"></span>';
    	}
    }

    If you guys make this option customizable it would be just great!

    • This reply was modified 1 year, 3 months ago by aljesco.
    Thread Starter aljesco

    (@aljesco)

    Oh I was missing that there is already such option exists under “Featured Image” section in visual editor https://i.imgur.com/9rbmJJz.png

    Theme Author creativethemeshq

    (@creativethemeshq)

    @aljesco glad you found it 🙂

    Cheers!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom ratio of post image in blog/archive’ is closed to new replies.