PATH:
home
/
niazsaze
/
public_html
/
wp-content
/
themes
/
flatsome
/
inc
/
shortcodes
<?php // [logo img=""] function ux_logo( $atts, $content = null ){ extract( shortcode_atts( array( 'class' => '', 'visibility' => '', 'img' => '', 'image_size' => 'original', 'padding' => '15px', 'title' => '', 'hover' => '', 'link' => '', 'target' => '_self', 'rel' => '', 'height' => '50', ), $atts ) ); $classes = array('ux-logo', 'has-hover', 'align-middle', 'ux_logo', 'inline-block'); $org_img = ''; if ( $class ) $classes[] = $class; if ( $visibility ) $classes[] = $visibility; $height = intval( $height ); $width = 'auto'; $link_atts = array( 'target' => $target, 'rel' => array( $rel ), ); if(!$img){ $org_img = get_template_directory_uri().'/assets/img/logo.png'; $width = ($height / 84) * 400 + (intval($padding)*2).'px'; } if ( $img && ! is_numeric( $img ) ) { $org_img = $img; } elseif ( $img ) { $img_src = wp_get_attachment_image_src( $img, $image_size ); if ( $img_src ) { $org_img = $img_src[0]; $org_height = $img_src[2]; // Check if width and height is set, because svg images has no size. if ( $img_src[1] > 0 && $img_src[2] > 0 ) { $width = $img_src[1]; $width = ( intval( $height ) / intval( $org_height ) ) * intval( $width ) + ( intval( $padding ) * 2 ) . 'px'; } else { $width = 'auto'; } } } // Set inner tag $inner_tag = $link ? 'a' : 'div'; $content = '<div class="' . esc_attr( implode( ' ', $classes ) ) . '" style="max-width: 100%!important; width: ' . esc_attr( $width ) . '!important"><' . $inner_tag . ' class="ux-logo-link block image-' . esc_attr( $hover ) . '" title="' . esc_attr( $title ) . '"' . flatsome_parse_target_rel( $link_atts ) . 'href="' . esc_url( $link ) . '" style="padding: ' . esc_attr( $padding ) . ';"><img src="' . esc_url( $org_img ) . '" title="' . esc_attr( $title ) . '" alt="' . esc_attr( $title ) . '" class="ux-logo-image block" style="height:' . esc_attr( $height ) . 'px;" /></' . $inner_tag . '></div>'; return $content; } add_shortcode('logo', 'ux_logo');
[-] ux_video.php
[edit]
[-] ux_stack.php
[edit]
[-] gap.php
[edit]
[-] ux_payment_icons.php
[edit]
[-] row.php
[edit]
[-] page_header.php
[edit]
[-] ux_slider.php
[edit]
[-] buttons.php
[edit]
[-] scroll_to.php
[edit]
[-] product_flip.php
[edit]
[-] messages.php
[edit]
[-] ux_banner_grid.php
[edit]
[-] tabs.php
[edit]
[-] ux_translation.php
[edit]
[-] ux_banner.php
[edit]
[-] price_table.php
[edit]
[-] ux_products.php
[edit]
[-] ux_html.php
[edit]
[-] ux_pages.php
[edit]
[-] ux_menu_title.php
[edit]
[-] search.php
[edit]
[-] custom-product.php
[edit]
[-] ux_products_list.php
[edit]
[-] ux_lottie.php
[edit]
[-] accordion.php
[edit]
[+]
ux_countdown
[-] featured_box.php
[edit]
[-] titles_dividers.php
[edit]
[-] ux_instagram_feed.php
[edit]
[-] ux_image.php
[edit]
[-] ux_menu_link.php
[edit]
[-] ux_gallery.php
[edit]
[-] google_maps.php
[edit]
[-] ux_sidebar.php
[edit]
[-] portfolio.php
[edit]
[-] product_categories.php
[edit]
[-] follow.php
[edit]
[-] lightbox.php
[edit]
[-] team_members.php
[edit]
[-] testimonials.php
[edit]
[-] blog_posts.php
[edit]
[-] ux_image_box.php
[edit]
[-] ux_logo.php
[edit]
[-] ux_text.php
[edit]
[-] sections.php
[edit]
[-] share.php
[edit]
[-] ux_hotspot.php
[edit]
[+]
..
[-] ux_menu.php
[edit]
[-] ux_nav.php
[edit]
[+]
commons
[-] text_box.php
[edit]