Skip to content

Instantly share code, notes, and snippets.

View nine2uk's full-sized avatar

nine2uk nine2uk

View GitHub Profile
@westcoastdigital
westcoastdigital / gp-svg-logo.php
Last active December 22, 2021 07:58
GeneratePress: Output inline SVG code instead of as an image
/** Updated and tested with GeneratePressVersion: 2.4.2 **/
/**
* Check if logo is svg and output svg code instead of image
*/
function generate_construct_logo() {
$logo_url = ( function_exists( 'the_custom_logo' ) && get_theme_mod( 'custom_logo' ) ) ? wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' ) : false;
$logo_url = ( $logo_url ) ? $logo_url[0] : generate_get_option( 'logo' );
$logo_url = esc_url( apply_filters( 'generate_logo', $logo_url ) );