• 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' );
Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Supported Business

    (@supportedbusiness)

    The value for ‘full’ seems to be hardcoded here (https://github.com/oceanwp/oceanwp/blob/7163ab345155fd401f0e507128a2da191bc1475e/inc/helpers.php#L2485)

    $bg_img = wp_get_attachment_image_src( $bg_img, 'full' );

    But the filter in my original post should happen BEFORE this line happens, and only if it is a numeric value.

    From what I can see, the filter I’ve got SHOULD be working, but it seems to be ignoring it?

    Hello @supportedbusiness,

    Thank you for taking the time to update this topic and providing additional details that allow us to reproduce the issue. We did see this happening on our end, so we’ll share this topic with the developer team, and it will be fixed/improved for the next updates.

    I appreciate your patience until the issue is resolved.

    Best Regards

    Thread Starter Supported Business

    (@supportedbusiness)

    Hello @skalanter,

    Do you have any update on this please? It’s been a month since your last message of acknowledging the issue, but there’s been absolutely no update.

    I would like to know the progress of this issue please, as it still needs resolving.

    Thank you.

    Thread Starter Supported Business

    (@supportedbusiness)

    Hi @skalanter,

    Can you please update me on this issue? I’ve had no response from you and it’s now been 3 months since you acknowledged the issue and said it would be fixed.

    I’ve been looking at the GitHub issues and Pull Requests for OceanWP, and I can’t see anywhere that this has been raised or even mentioned. Have you not actioned this support request at all?

    Would it be better if I raised an issue in GitHub myself?

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

The topic ‘Page Title Background Image Size’ is closed to new replies.