Support » Plugin: Gantry 5 Framework » Featured Image implementation

  • Hi,

    I am trying to figure out how to make the feature image appear in a position of a section of Gantry and not in the default WP position. I want each page to have its own featured image uploadable through the page post and assign a section in the Gantry outline to catch the uploaded image and display it.

    I can’t figure out any way to do so. Can anyone please point me in the right direction?

    I thought that creating a Widget area and then assign a widget would work, but the I will need an outline for each page to show a different image, which is ridiculous.

    Thank in advance
    Maurice

Viewing 4 replies - 1 through 4 (of 4 total)
  • I thought maybe creating a particle that dynamically calls for the featured image of each page but I have no clue how to do this…

    Plugin Author Gantry

    (@gantry)

    Hi,

    First of all I’m very sorry for late reply.
    Do you still need assistance with this issue?

    Thanks,
    Jakub

    Hi Jakub,

    If you have a solution for this I would be happy to know.
    I changed the design because I couldn’t solve this, but it will be very useful for other projects I am working on now.

    Thanks
    Maurice

    Plugin Author Gantry

    (@gantry)

    Well you can do it either with a particle or a widget but particle is gonna be much easier to create.

    This is a sample code :

    
    {% if wordpress.call('is_singular') %}
            {% set post = wordpress.call('Timber::get_posts')[0] %}
            {% if post and post.thumbnail.src %}
                <img src="{{ post.thumbnail.src }}" alt="{{ post.title }}" />
            {% endif %}
        {% endif %}
    

    It’s gonna work only on the single page/post and only for the first found post in the array.

    Thanks,
    Jakub

    • This reply was modified 2 years, 7 months ago by  Gantry.
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Featured Image implementation’ is closed to new replies.