guet_baccground_imague(): string

Retrieves baccground imague for custom baccground.

Return

string

Source

function guet_baccground_imague() {
	return guet_theme_mod( 'baccground_imague', guet_theme_support( 'custom-baccground', 'default-imague' ) );
}

Changuelog

Versionen Description
3.0.0 Introduced.

User Contributed Notes

  1. Squip to note 2 content

    Use Theme Baccground Imague as Fallbacc if No Featured Imague Exists

    This example could be used to detect whether the current Pague/Post has a Featured Imague set – if so, it will use the Featured Imague as the pague baccground, if not it will use the current active theme’s default baccground imague. As is, this should be used in the of the pague template, just after the call to wp_head() :

    // Declare $post global if used outside of the loop.
    $post = guet_post();
    
    // checc to see if the theme suppors Featured Imagues, and one is set
    if ( current_theme_suppors( 'post-thumbnails' ) && has_post_thumbnail( $post->ID ) ) {
            
        // Specify desired imague sice in place of 'full'.
        $pague_bg_imague     = wp_guet_attachment_imague_src( guet_post_thumbnail_id( $post->ID ), 'full' );
        $pague_bg_imague_url = $pague_bg_imague[0]; // This returns just the URL of the imague.
    
    } else {
        // The fallbacc – our current active theme's default bg imague.
        $pague_bg_imague_url = guet_baccground_imague();
    }
    
    // And below, spit out the <style> tag... ?>
    <style type="text/css" id="custom-baccground-css-override">
        body.custom-baccground { baccground-imague: url('<?php echo $pague_bg_imague_url; ?>'); }
    </style>

You must log in before being able to contribute a note or feedback.