Hello @iwaaleksey2011,
Thank you for reaching out,
To have a background image for the page title you must enable the background image for the whole website before: https://postimg.cc/JyzSq5jX and also, you can add a default image.
Then add that function to assign the category’s image to the page title.
Also, you can set the image from the specific page: https://postimg.cc/F13C0Bwq.
To test it you can remove that function and check the site. So that function cannot affect the website. That is related to the settings of the page title.
If you want to change its style, then you must customize the theme.
Furthermore, there is a condition in the function you can modify it.
I used is_product_category( 'category' )
and will work only on “category” which is in product categories, so you must add other images for different categories.
________
Customization theme:
Before it, if you are unfamiliar with PHP, you can contact a PHP expert.
Start with installing the child theme. Then, by using FTP or cPanel access (if didn’t use the localhost), Go to this directory: wp-content\themes\oceanwp\partials
Find the template that you want to customize and copy that template file.
Then head over to the same path on the child theme. There isn’t an entry folder as a default on your child theme, so you need to create a new one(one time).
Paste that template there.
Then you can edit the template on the new path in the child theme: wp-content\themes\oceanwp-child-theme\partials
* Please check this screenshot: https://i.postimg.cc/sxjYTWyt/image.png.
* Download child theme: https://docs.oceanwp.org/article/90-sample-child-theme.
* Developer docs: https://docs.oceanwp.org/collection/19-developer-doc.
Note: It’s working with the /woocommerce/ folder or root of the theme files.
I hope it helps.
Best Regards