PATH:
home
/
niazsaze
/
public_html
/
wp-content
/
themes
/
flatsome
/
inc
/
shortcodes
<?php function ux_navigation($atts) { extract(shortcode_atts(array( 'class' => '', 'visibility' => '', 'parent' => '', 'align' => 'left', 'style' => 'line', 'type' => 'vertical', // horizontal / vertical 'size' => '', 'case' => 'uppercase', //'bg_color' => '', //'height' => '', //'sticky' => '', ), $atts)); ob_start(); global $post; $current = get_the_ID($post->ID); $classes = array('nav'); if($class) $classes[] = $class; if($visibility) $classes[] = $visibility; if($case) $classes[] = 'nav-'.$case; if($type) $classes[] = 'nav-'.$type; if($size) $classes[] = 'nav-size-'.$size; if($style) $classes[] = 'nav-'.$style; if($align) $classes[] = 'text-'.$align.' nav-'.$align; echo '<div class="nav-wrapper">'; echo '<ul class="'.esc_attr(implode(' ',$classes)).'">'; if ( is_page() && $post->post_parent && !$parent ){ $childpages = get_pages( array( 'child_of' => $post->post_parent, 'sort_column' => 'menu_order' ) ); } else { $post_id = $post->ID; if($parent) { if(!is_numeric($parent)){ $id = get_page_by_path( $parent ); $parent = $id->ID; } $post_id = $parent; } $childpages = get_pages( array( 'child_of' => $post_id, 'sort_column' => 'menu_order' ) ); if(!$childpages) echo '<p class="lead shortcode-error text-center">Sorry, no pages was found</p>'; } foreach ( $childpages as $page ) { $classes = ''; if($page->ID == $current) $classes = 'active'; echo '<li class='.esc_attr($classes).'><a href="'.esc_url(get_the_permalink($page->ID)).'">'.wp_kses_post($page->post_title).'</a></li>'; } echo '</ul>'; echo '</div>'; $content = ob_get_contents(); ob_end_clean(); return $content; } add_shortcode("ux_nav", "ux_navigation");
[-] 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]