• slipperyman

    (@slipperyman)


    Hi. I’ve made a template with lower third overlay. And put some text (from ACF).
    But only the Image is clickable and linked to post.
    How can I make the text points tto the post?

    Thanks

Viewing 1 replies (of 1 total)
  • Thread Starter slipperyman

    (@slipperyman)

    Not exactly on blocks but the whole block

    //Link the whole result block to post
    function cl_element_render_output( $output, $element_type  ) {
    	global $post;
    	// Modify the output
    	$output = '<a href="' . get_permalink($post->ID) . '">' . $output . '</a>';
    	// Always return in WP filters
    	return $output;
    }
    add_filter( 'custom-layouts/element/render_output', 'cl_element_render_output', 10, 2 );
Viewing 1 replies (of 1 total)
  • The topic ‘Link blocks to post’ is closed to new replies.