Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function avia_logo( $use_image = '', $sub = '', $headline_type = 'h1', $dimension = '' )
- {
- $headline_type = apply_filters( 'avf_logo_headline', $headline_type );
- $sub = apply_filters( 'avf_logo_subtext', $sub );
- $alt = apply_filters( 'avf_logo_alt', get_bloginfo( 'name' ) );
- $link = apply_filters( 'avf_logo_link', home_url( '/' ) );
- $title = '';
- if( $sub )
- {
- $sub = "<span class='subtext'>{$sub}</span>";
- }
- if( $dimension === true )
- {
- $dimension = "height='100' width='300'"; //basically just for better page speed ranking :P
- }
- $logo = avia_get_option( 'logo' );
- if( ! empty( $logo ) )
- {
- $logo = apply_filters( 'avf_logo', $logo, 'option_set' );
- if( is_numeric( $logo ) )
- {
- $logo_id = $logo;
- $logo = wp_get_attachment_image_src( $logo_id, 'full' );
- if( is_array( $logo ) )
- {
- $logo = $logo[0];
- $title = get_the_title( $logo_id );
- }
- }
- $title = apply_filters( 'avf_logo_title', $title, 'option_set' );
- $logo = "<img {$dimension} src='{$logo}' alt='{$alt}' title='{$title}' />";
- $logo = "<{$headline_type} class='logo'><a href='{$link}'>{$logo}{$sub}</a></{$headline_type}>";
- }
- else
- {
- $logo = get_bloginfo('name');
- $use_image = apply_filters( 'avf_logo', $use_image, 'option_not_set' );
- $use_image = '';
- if( ! empty( $use_image ) )
- {
- $title = apply_filters( 'avf_logo_title', $logo, 'option_not_set' );
- $logo = "<img {$dimension} src='{$use_image}' alt='{$alt}' title='{$title}'/>";
- }
- $logo = "<{$headline_type} class='logo bg-logo'><a href='{$link}'>{$logo}{$sub}</a></{$headline_type}>";
- }
- $logo = apply_filters( 'avf_logo_final_output', $logo, $use_image, $headline_type, $sub, $alt, $link, $title );
- return $logo;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement