PHP code example of mitogh / katana

1. Go to this page and download the library: Download mitogh/katana library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mitogh / katana example snippets




add_filer( 'katana_refine', function($sizes, $id) {
    $title = strtolower( get_the_title( $id ) );
    if ( $title === 'tomacco' ) {
      return [];
    } else {
      return $sizes;
    }
}, 10, 2);

add_filter('katana_refine_page', '__return_empty_array');

add_image_size( 'author_profile_image', 350, 350, true );

add_filter('katana_refine_105', 'allow_only_author_profile_image');

function allow_only_author_profile_image( $sizes ){
  return array( 'author_profile_image' );
}

add_filter('katana_refine_full', 'image_sizes_for_full_page_template');

function image_sizes_for_full_page_template( $sizes ){
  return array( 'poster', 'landscape' );
}