• Hi.

    I am trying to update Page Titles so the Featured Image associated to the Post/Page is used as the background image instead of having to manually specify a specific image as the page title background image. Don’t see an option for this in Customizer. Is this possible?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hello,
    you can navigate to
    Dashboard> Appearance> Customize> General Options> Page Title.
    Under style option use ‘Background Image’, after that it will give you the option to choose an image from media gallery.

    I think this will help.

    Hello @jmccrone,

    Thank you for reaching out,

    If I understand your request correctly, from WP Dashboard > Appearance > Customizer > General Options > page Title, set a general page title styling with the background image.
    https://postimg.cc/t1VTcPMc

    Then it’ll show that style on all pages/posts/etc.

    Also, by going to your desired page/post and only setting the background image for the title in OceanWP Settings, that background image will be changed to a new one: https://postimg.cc/4YHh9mgX.

    For your information, There is an option for a single blog post, which can set the featured images automatically: https://postimg.cc/mzYn2LDw.

    I hope it helps.
    Best Regards

    Thread Starter jmccrone

    (@jmccrone)

    Thanks. I saw those options but neither address my need which is to have the Product Archives page pull in the archive (product category) image as the background image for page title. Doesn’t appear that is an option in the theme settings in customizer. I see I can set a specific image as the page title background for the entire site or specify a specific image for an individual Page or Post, but don’t see any option to make the background image of page title dynamic for Archive template.

    Hello @jmccrone,

    Thank you for reaching out,

    The category archive page(s) needs customization and add the background image by using code so that you can follow the steps explained in this link:
    https://docs.oceanwp.org/article/459-alter-the-page-header-background-image
    Also, for conditional tags, you can use the following articles
    https://developer.woo.com/docs/conditional-tags-in-woocommerce/

    For example, I used this one, and working well on my end:

    /**
     * Alter your page header background image
     *
     * Replace is_singular( 'post' ) by the function where you want to alter the layout
     * Place your image in your "img" folder
     */
    function my_page_header_bg_img( $bg_img ) {
    
    	if ( is_product_category( 'category-name' ) ) {
    		$bg_img = 'https://example.com/img/my-image.jpg';
    	}
    
    	// Retrun
    	return $bg_img;
    
    }
    add_filter( 'ocean_page_header_background_image', 'my_page_header_bg_img' );

    Screenshot: https://postimg.cc/dkz0Z3cx.

    I hope it helps.
    Best Regards

    • This reply was modified 2 years, 2 months ago by Shahin.
Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Featured Image as Title background’ is closed to new replies.