Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Change Logo for Spesific Page || Category Page for Example */
- function jnews_generate_header_logo( $echo = true ) {
- if ( get_theme_mod( 'jnews_header_logo_type', 'image' ) === 'image' ) {
- $logo = get_theme_mod( 'jnews_header_logo', get_parent_theme_file_uri( 'assets/img/logo.png' ) );
- $logo_retina = get_theme_mod( 'jnews_header_logo_retina', get_parent_theme_file_uri( 'assets/img/logo@2x.png' ) );
- $alt = get_theme_mod( 'jnews_header_logo_alt', get_bloginfo( 'name' ) );
- /*Dark logo*/
- $logo_dark = get_theme_mod( 'jnews_header_logo_darkmode', get_parent_theme_file_uri( 'assets/img/logo_darkmode.png' ) );
- $logo_retina_dark = get_theme_mod( 'jnews_header_logo_retina_darkmode', get_parent_theme_file_uri( 'assets/img/logo_darkmode@2x.png' ) );
- /* START Custom Change || If is Category Page */
- if ( is_category() ) {
- $logo = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Service_mark.svg/1280px-Service_mark.svg.png';
- $logo_retina = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Service_mark.svg/1280px-Service_mark.svg.png';
- $alt = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Service_mark.svg/1280px-Service_mark.svg.png';
- $logo_dark = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Service_mark.svg/1280px-Service_mark.svg.png';
- $logo_retina_dark = 'https://upload.wikimedia.org/wikipedia/commons/thumb/a/ac/Service_mark.svg/1280px-Service_mark.svg.png';
- }
- /* END Custom Change */
- return JNews\Image\Image::generate_image_retina( $logo, $logo_retina, $alt, $echo, $logo_dark, $logo_retina_dark );
- } else {
- $logo_text = get_theme_mod( 'jnews_header_logo_text', 'Logo' );
- return jnews_generate_logo_text( $logo_text, $echo );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement