[Support request] Change site logo link

Home Forums Support [Support request] Change site logo link

Home Forums Support Change site logo link

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1654680
    Alfonso

    Hi there,

    I need to edit site logo link, to refresh the current page, how i can do it? Thanks!

    #1655112
    Ying
    Staff
    Customer Support

    Hi Alfonso,

    You could use this PHP snippet:

    add_filter( 'generate_logo_href', function() {
        return $_SERVER ;
    } );

    Adding PHP: https://docs.generatepress.com/article/adding-php/

    Let me know 🙂

    #1655119
    Alfonso

    Hi there,

    I’ve added the PHP Snippet, the site logo link is working fine but is displaying a error message:

    https://snipboard.io/dFDBUG.jpg

    #1655305
    Alfonso

    Hello. How i can fix the error message?

    #1655379
    Elvin
    Staff
    Customer Support

    Hi there,

    Can you try this instead?

    add_filter( 'generate_logo_output', 'tu_logo_class', 10, 3 );
    function tu_logo_class( $output, $logo_url, $html_attr ) {
    	printf(
    		'<div class="site-logo">
    			<a href="%1$s" title="%2$s" rel="home" onclick="location.reload(true);">
    				<img %3$s />
    			</a>
    		</div>',
    		'#',
    		esc_attr( apply_filters( 'generate_logo_title', get_bloginfo( 'name', 'display' ) ) ),
    		$html_attr
    	);
    }

    Let us know how it goes.

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.