• I’m a newbee and not a programmer… That makes it hard for me ?? Hope someone here can help me.

    What I need
    ————

    A block that is like the default image block, just need to change the marging-top to -8px

    What I did
    ———–
    Added a new lazy block
    named it “header image”
    added image as controll

    Now I can choose the image when I creat a new post… but, no wonder, there is no output in the post editor and in the post preview.

    I think I need to place code in the “Frontend HTML” and “Editor HTML” section, but don’t know what to get 100% the same block like the default image block. Changing the margin-top then shouldn’t be an issue.

    Does someone know where I get the code from the default image block?

    • This topic was modified 5 years, 6 months ago by hatschiii.
Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter hatschiii

    (@hatschiii)

    I also need the default image options which can be set in the right sidebar (block options)

    Thread Starter hatschiii

    (@hatschiii)

    no one an idea?

    Plugin Author Nikita

    (@nko)

    Hi.

    You can’t just clone the core image block. You are only able to make something similar. You can see here an example on how to output image HTML https://lazyblocks.com/documentation/blocks-controls/image/

    Regards, nK.

    Thread Starter hatschiii

    (@hatschiii)

    Thanks nK. This I have sean in the meantime and it is working… but without the image options like size. Do to performance issues I don’t want to place allways the full size image if I only need a smaller version.

    There are wordpress solution to show smaller images as output. You can add a function in your functions.php file of the theme for it, something like this

    add_theme_support(‘post-thumbnails’);
    add_image_size(‘medium’, 350, ”, true); // Medium Thumbnail
    // add_image_size(‘custom-size’, 700, 200, true); // Custom Thumbnail Size call using the_post_thumbnail(‘custom-size’);

    Output your image using wordpress default the_post_thumbnail(‘your required size’); in php output of lazy block.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom Image Block’ is closed to new replies.