Forum Replies Created

Viewing 15 replies - 1 through 15 (of 15 total)
  • Thread Starter Wolfram Kl?ger

    (@wolframhk)

    Marc, thanks a lot!

    Very useful update.

    Now, of course, I have to save my past as well and add the 5th star to my rating. Your plugin is my new standard!

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    Thanks Marc,

    you are right. I did another test.

    Any changes to headlines are not updated in the TOC. But: the frontend is indeed updated, after reload.

    In the backend, I have to re-open the page. This should be improved.

    2. to 4. yes, of course, optional. We have to find someone else ??

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    Johannes, you’re a wizard ??

    Thank you so much. Added. Tested. Works.

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    Thanks again.

    Where / how would I add this option to my theme?

    The snippet from above can be disabled, after running once. It’s the same as if I had modified options.php.

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    Thanks.

    Yes. “Beitragsbild”, english probably “Featured Image”, appears in my standard Gutenberg block selection. No extra extension or something.

    Funny enough. As mentioned, it *has* a link, if the setting is on. If so, of course, it’s linking to itself. I’m too dumb to imagine a useful application but …

    For now, I have to add the featured image twice. One for the featured image setting, one in the content, as standard image block. Then, your plugin does its thing. Kind of weird, but not really a problem.

    Maybe one day I find a better solution, using GeneratePress and GenerateBlocks.

    Regarding the snippet: Probably you’re entirely right. But how would you compose the snippet? I couldn’t find an example for

    apply_filters( “option_{$option}”, mixed $value, string $option )

    applied to

    ‘image_default_link_type’, ‘file’

    That’s above my head ??

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    Meanwhile, I discovered the Gutenberg block “Featured Image” (Beitragsbild).

    Its settings on the right are:

    – Link to post: yes or no (default)
    – Additional CSS classes

    How could I apply your plugin to this block type, the same as to standard image and gallery blocks?

    Of course, I see, I have to promise, I will _never_ activate the link to post switch ??

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    Hi Johannes,

    thanks a lot. That’s a cute trick, setting the image_default_link_type to ‘file’.

    Though, instead of editing wp-admin/options.php, I’d prefer adding a little snippet to my functions.php, via the brave plugin

    Code Snippets

    The idea is “stolen” from writenowdesign.com

    This is my version:

    add_action( 'after_setup_theme', 'whk_image_defaults' );
    
    function whk_image_defaults() {
    	update_option( 'image_default_link_type', 'file' );
    	update_option( 'image_default_size', 'large' );
    	update_option( 'image_default_align', 'center' );
    }

    In addition to link_type, this snippet also defines default_size and default_align to my preferences.

    Works like a charm.

    BUT: featured images, yes, on archives, they are usually linked to full posts, but on single post, they act as the first image below the title. Then, there is no link, and unfortunately no lightbox, as well?!

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    ahem, just to mark this resolved ??

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    Thank you so much, until next!

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    My idea is, I could fix it by CSS.

    But, generally, what’s the benefit of wrapping the call in ob_* ?

    What’s the disadvantage, if I keep the buffer calls for proper sequence?

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    Of course ??

    Done!

    Very interesting result: WP Youtube Lyte works as before. You’re awesome, and you know it, I suppose …

    BUT: The GenerateBlock content template gets disturbed. Calling Lyte without ob_*, pushes the video from last to top position.

    The template is basically just a post title, consisting of

    – Kicker (say headline of the headline)
    – Headline
    – Post Meta (Author, Date, Date)
    – Subline (lead text, 1 or 2 lines)
    – Featured Video

    With ob_*, everything as expected.

    Without ob_*, the video pops before the kicker. Everything else is fine.

    Any idea, how I could fix that?

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    You mean, unbuffered is good enough, like this?

    add_shortcode( 'featured_youtube_video', function() {
        // ACF(featured_youtube_id, post_id)
        $youtube_id = get_field('featured_youtube_id', get_the_ID());
        if( $youtube_id ) {
            // WP Youtube Lyte
    	echo do_shortcode('[lyte id='.$youtube_id.']');
        }
    } );

    I actually have no idea, what ob_* is doing here. I thought, this is kind of default, and required for such shortcode snippets.

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    I’m sorry. I had no direct contact to Tom. His team finished this topic for now. So I have to fall back to the paginated archive, instead of infinite scroll.

    Without GPP’s Infinite Scrolling, WP Lyte works like a charm. PageSpeed Insights scores 84. That’s not too bad, for vanilla hosting, no cache, just AutOptimize, so far.

    Focussing on my little snippet again: could I further improve the Lyte call?

    To me, it looks slightly over-complicated. But maybe, that’s my PHP allergy ??

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    Thanks again, I’ll try my very best to convince Tom ??

    Thread Starter Wolfram Kl?ger

    (@wolframhk)

    Hey Frank, thanks a lot.

    BUT: infinite scroll is a checkbox. I have no idea, what Tom Usborne does with it, which JS he’s calling ??

    Or did I get you wrong, and you mean

    echo do_shortcode(‘[ly.te id=’.$youtube_id.’]’);

    instead of

    echo do_shortcode(‘[lyte id=’.$youtube_id.’]’);

    in my PHP code snippet, see above?

    (yes, the only difference is that little dot between ly and te ??

    Where / how else could I get access to this call, using GPP & GB?

Viewing 15 replies - 1 through 15 (of 15 total)