Are you a GenerateCustomer?

Do you have an active GP Premium or GenerateBlocks Pro license key?

Create a GenerateSupport account for GeneratePress and GenerateBlocks support in one dedicated place.

Create an account
Already have a GenerateSupport account? Login

Just browsing?

Feel free to browse the forums. Support for our free versions is provided on WordPress.org (GeneratePress, GenerateBlocks).

Want to become a premium user? Learn more below.

Feature Image

  • Hi There,

    I’ve implemented a gallery which will displayed instead of post featured image. By default it shows one image in landscape format. Clicking on it will bring up a lightbox and you can you left and right arrows in order to navigate through the post attached media. In order to make this work I am using a GP Element (Hook/PHP) a plugin justified image grid. The definition here fits to the overall container witdh of 1200px and particularly good for images in landscape format. It looks like a featured image, but it works like a gallery. This works very good. Let’s call the solution VirtualFeaturedImage.

    The issue I encounter is the following: once the featured image is in portrait ratio the idea of a featured image is broken. The implemented solution is showing the first two images of the gallery. Reason for this is the overall container witdh 1200px. So I cut the gallery to one image what I don’t want.

    I am thinking about a solution with a more narrow container width of ~400px when finding a an featured Image in portrait format with the VirtualFeaturedImage and keeping the default container width 1200px in case of a landscape format.

    Can you give some thoughts, please?

    Thanks in advance, Ernst Wilhelm
    –> Some more information via PI

  • Hi there,

    The theme can NOT control content that are from the 3rd party plugins, I’m not sure what we can help with here.

    Let me know!

  • Hi, dear Ying.

    I don’t need any help with the 3rd party plugin. I just thought you would appreciate some background information for better understanding.

    I am wondering how can I call a custom block with a container and some php coding inside. What would be your approach?

    Many thanks in advance, Ernst Wilhelm

  • I am wondering how can I call a custom block with a container and some php coding inside. What would be your approach?

    Maybe creating a custom hook to store the container, and create a shortcode for the PHP coding, and add the shrotcode to the custom hook as well.

  • Hi There. I’ve created a custom block. Is there a json file be stored for these definitions. If so can you tell me where this file is located?

  • GP does not have a theme.json file.

    Are you trying to call the custom block on the site?

    If so, try this method:

    1. Add your blocks into a block element – hook, set hook name to custom > portable_hook, set location to entire site.

    2. Add this PHP code to create a shortcode which can pull the block from the element. Then you can use [my_portable_hook] to pull the element.

    add_shortcode('my_portable_hook', function($atts){
        ob_start();
        do_action('portable_hook');
        return ob_get_clean();
    });

    Let me know if this helps!

  • Hi.

    Indeed there is a possibility to export the custom block definitions as a .json file.
    Lucky me, now I have two options for investigation.

    I will let you know.

  • Sure 🙂

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.