Override latest-posts.php
-
In WordPress 5.8.2 is a block function, calling the lastest posts.
The function lists latest post and the title of the post. I need to add a class to the title link.
$title = get_the_title( $post ); if ( ! $title ) { $title = __( '(no title)' ); } $list_items_markup .= sprintf( '<a class="wp-block-button__link add_to_cart_button" href="%1$s">%2$s</a>', $post_link, $title );
This works fine in latest-posts.php, but I am not able to override the function properly. Maybe someone knows a snippet how to do this. In other words I need to change the code of latest-posts.php in the right form, so it will not be deleted by updates. I would be very happy about any tipp.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Override latest-posts.php’ is closed to new replies.