• Hi,

    I’m just discovering this plugin and it seems amazing.

    I’ve got one problem, when trying to insert a image.

    In the reference, you say for image field :

    “size – size of image to get: thumbnail, middle, large, full (default) or custom defined size”

    .

    OK for thumb, middle, large and full, but I don’t figure how to use a custom defined size, maybe I didn’t find the right syntax ?!

    https://ww.wp.xz.cn/plugins/custom-content-shortcode/

Viewing 1 replies (of 1 total)
  • Plugin Author Eliot Akira

    (@miyarakira)

    Hello, sorry for the late reply. This plugin handles the display of fields, but not their creation.

    So, to add custom defined image sizes, you can use another plugin for that purpose, or edit your theme’s functions.php.

    If the theme doesn’t support featured images, then first add:

    add_theme_support( 'post-thumbnails' );

    Then:

    add_image_size( 'sidebar-thumb', 120, 120, true ); // Hard Crop Mode
    add_image_size( 'homepage-thumb', 220, 180 ); // Soft Crop Mode
    add_image_size( 'singlepost-thumb', 590, 9999 ); // Unlimited Height Mode

    These are examples of the parameters you can use. After this, any image you upload will be available in the defined custom sizes. If you’d like to use the custom size for pre-existing images, you can use the plugin Regenerate Thumbnails.

    To display it using the loop & content shortcodes:

    [loop type="post" count="3"]
        [content field="image" size="sidebar-thumb"]
    [/loop]

    Let me know if you need more information.

Viewing 1 replies (of 1 total)

The topic ‘Image with custom size’ is closed to new replies.