• jokr1985

    (@jokr1985)


    Hi,

    when I use the code suggested on your pages for the filter generate_single_featured_image_output it is creating a featured image, even though I have deactivated in the generatepress post settings.

    add_filter( 'generate_single_featured_image_output', function( $output, $image_html ) {
        printf(
            '<div class="featured-image">
                <a href="%1$s" data-fancybox="gallery">
                    %2$s
                </a>
            </div>',
            get_the_post_thumbnail_url(),
            get_the_post_thumbnail(
    				get_the_ID(),
    				apply_filters( 'generate_page_header_default_size', 'full' ),
    				array(
    					'itemprop' => 'image',
    				)
    			)
        );
    }, 10, 2 );

    So I would expect the featured image will not be created when it’s deactivated. Searching for a condition I could use to evaluate the deactivation did not bring any result.

    Kind regards
    Jo

    • This topic was modified 5 years ago by jokr1985.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Theme Author Tom

    (@edge22)

    Hi there,

    I’m not too sure what you mean. How are you disabling featured images?

    Thread Starter jokr1985

    (@jokr1985)

    Hi Tom,

    thanks for your fast response (looks like you stand up quite early ??

    I deactivate it with the generate options (toolbox within the post/page):

    <label for="meta-generate-disable-post-image" style="display:block;margin-bottom:3px;" title="Beitragsbild / Seitenkopf">
    	<input type="checkbox" name="_generate-disable-post-image" id="meta-generate-disable-post-image" value="true">Beitragsbild / Seitenkopf</label>

    Unluckily it’s German, but it should be something like Featuredimage / Page header.

    BTW: Other themes provide the option to set the featured images size + the location/orientation.
    It would be nice to have something similar ??

    Kind regards
    Jo

    • This reply was modified 5 years ago by jokr1985.
    Theme Author Tom

    (@edge22)

    Ah, that’s an option in our pro version, which we aren’t allowed to support here (it’s a www.remarpro.com rule).

    The filter above shouldn’t interfere with that specific feature – perhaps the premium version you’re using needs updating?

    Thread Starter jokr1985

    (@jokr1985)

    Hi Tom,

    thanks, yes we have the Premium edition.
    We got it from our website design agency.
    But I can’t create a post in your support forum, because I don’t have the license myself.
    Unluckily they are busy with other stuff and it does not change behavior.
    But I consider it still as a bug, when your filter does not respect the settings of your options ??
    In case you can’t support we need to live with this bad situation of having tow pictures in the post (one from the content and one from the featured image) ??
    Thanks
    Jo

    Theme Author Tom

    (@edge22)

    Do you know what version of the pro plugin you’re using?

    Is the sole purpose of the filter to add data-fancybox="gallery" to the <a> element?

    Thread Starter jokr1985

    (@jokr1985)

    Hi Tom,

    we use GP Premium-Version 1.9.1

    The purpose is to have
    a) by default a thumbnail featured image on the right side and
    b) add fancybox to it
    except we disable it and put a large image, because afaik from the theme itself we cannot define per Post where to place the featured image and what size it should have.

    Kind regards
    Jo

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘generate_single_featured_image_output’ is closed to new replies.