Page Title Background Image Size
-
I’m struggling with being able to find a way to use a different image size other than the full size for the page title background image.
There doesn’t seem to be any option to select an image size within WordPress but I thought there must be a hook or filter to be able to change this.
When I found this page (https://docs.oceanwp.org/article/459-alter-the-page-header-background-image) I thought this would be it.
But it turns out (and isn’t very well documented) this only affects the CSS styling for the page title.
It does also mention an image URL but this is for the header, NOT the page title.
I’m trying to simply stop full size images be loaded for the background image on page titles, I’d much rather prefer either medium or large images.
Is there any possible way of doing this via a child theme?
// Page Title Background Image Size function my_page_header_bg_img( $url ) { // Get the attachment ID from the URL $id = attachment_url_to_postid($url); // Get the new URL $url = wp_get_attachment_image_url($id, 'medium'); // Return return $url; } add_filter( 'ocean_page_header_background_image', 'my_page_header_bg_img' );
The topic ‘Page Title Background Image Size’ is closed to new replies.
