[Resolved] Custom Category Logo Not Showing On Sticky Scroll For Category Single Post Pages

Home Forums Support [Resolved] Custom Category Logo Not Showing On Sticky Scroll For Category Single Post Pages

Home Forums Support Custom Category Logo Not Showing On Sticky Scroll For Category Single Post Pages

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #2299213
    Michelle

    How do I replace my site logo with a custom category logo on sticky scroll on category single post pages?

    #2299279
    Fernando
    Customer Support

    Hi Michelle,

    You can try this snippet:

    add_filter('generate_sticky_navigation_logo_output',function($output, $img_src, $image){
    	if( is_category(29) ){
    		$my_url = 'https://www.google.com';
    		$logo_src = 'https://cdn.reachingmyworld.com/wp-content/uploads/2022/06/18162522/Daily-Reach-Logo-For-Site.png';
    		$width = '150px';
    		$height = '150px';
    		return sprintf(
    				'<div class="sticky-navigation-logo">
    					<a href="%1$s" title="%2$s" rel="home">
    						<img src="%3$s" class="is-logo-image" alt="%2$s" width="%4$s" height="%5$s" />
    					</a>
    				</div>',
    				$my_url,
    				get_bloginfo( 'name', 'display' ),
    				$logo_src,
    				$width,
    				$height
    			);
    	}
    	return $output;
    }, 10, 3);

    Kindly replace 29 with you category ID

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