post_parent ) && $image->post_parent != $id ) $url .= '#main'; return $url; } add_filter( 'attachment_link', 'islev_enhanced_image_navigation', 10, 2 ); /** * Filters wp_title to print a neat tag based on what is being viewed. */ function islev_wp_title( $title, $sep ) { global $page, $paged; if ( is_feed() ) return $title; // Add the blog name $title .= get_bloginfo( 'name' ); // Add the blog description for the home/front page. $site_description = get_bloginfo( 'description', 'display' ); if ( $site_description && ( is_home() || is_front_page() ) ) $title .= " $sep $site_description"; // Add a page number if necessary: if ( $paged >= 2 || $page >= 2 ) $title .= " $sep " . sprintf( __( 'Page %s', 'islev' ), max( $paged, $page ) ); return $title; } add_filter( 'wp_title', 'islev_wp_title', 10, 2 ); add_filter( 'islev_portfolio_args', 'islev_portfolio_cat', 10, 1 ); function islev_portfolio_cat($args) { $portfolio_cat = of_get_option('g_portfolio_cat', 'from_all'); $portfolio_cat = isset( $portfolio_cat ) ? $portfolio_cat : "from_all"; if ( 'from_all' != $portfolio_cat ) { $args['cat'] = esc_attr($portfolio_cat); } return $args; } function islev_portfolio_show() { wp_reset_query(); global $post; $post_num = of_get_option( 'g_portfolio_per_page', 8 ); $post_num = intval($post_num); if ( '' == $post_num || 0 == $post_num ) { $post_num = 8; } $default_args = array( 'posts_per_page' => $post_num, 'ignore_sticky_posts' => 1 ); $args = apply_filters( 'islev_portfolio_args', $default_args ); $portf_query = new WP_Query( $args ); $islev_modals = ''; if ( $portf_query->have_posts() ): ?> <ul class="icgaleri"> <?php while ( $portf_query->have_posts() ) : $portf_query->the_post(); if ( has_post_thumbnail() ) { ?> <li> <?php the_post_thumbnail('large-thumb'); ?> </li> <?php } endwhile; ?> </ul> <ul class="list-inline text-center" id="icgaleri-pager"> <?php $count_portf = 0; while ( $portf_query->have_posts() ) : $portf_query->the_post(); if ( has_post_thumbnail() ) { ?> <li> <a data-slide-index="<?php echo $count_portf; ?>" href=""> <?php $attr=array('class' =>'slide-thumb'); the_post_thumbnail('portfolio-thumb'); ?> </a> </li> <?php } $count_portf++; endwhile; ?> </ul> <?php endif; wp_reset_postdata(); } function islev_add_portfolio_modals() { global $islev_portfolio_modals; if ( isset($islev_portfolio_modals) ) { echo $islev_portfolio_modals; } } add_filter( 'islev_portfolio2_args', 'islev_portfolio2_cat', 10, 1 ); function islev_portfolio2_cat($args) { $portfolio_cat = of_get_option('g_portfolio2_cat', 'from_all'); $portfolio_cat = isset( $portfolio_cat ) ? $portfolio_cat : "from_all"; if ( 'from_all' != $portfolio_cat ) { $args['cat'] = esc_attr($portfolio_cat); } return $args; } function islev_portfolio2_show() { wp_reset_query(); global $post; $post_num = of_get_option( 'g_portfolio2_per_page', 8 ); $post_num = intval($post_num); if ( '' == $post_num || 0 == $post_num ) { $post_num = 8; } $default_args = array( 'posts_per_page' => $post_num, 'ignore_sticky_posts' => 1 ); $args = apply_filters( 'islev_portfolio_args', $default_args ); $portf_query = new WP_Query( $args ); $islev_modals = ''; if ( $portf_query->have_posts() ): ?> <ul class="icgaleri"> <?php while ( $portf_query->have_posts() ) : $portf_query->the_post(); if ( has_post_thumbnail() ) { ?> <li> <?php the_post_thumbnail('fullwidth-post-thumbnail'); ?> </li> <?php } endwhile; ?> </ul> <ul class="list-inline text-center" id="icgaleri-pager"> <?php $count_portf = 0; while ( $portf_query->have_posts() ) : $portf_query->the_post(); if ( has_post_thumbnail() ) { ?> <li> <a data-slide-index="<?php echo $count_portf; ?>" href=""> <?php $attr=array('class' =>'slide-thumb'); the_post_thumbnail('portfolio-thumb'); ?> </a> </li> <?php } $count_portf++; endwhile; ?> </ul> <?php endif; wp_reset_postdata(); } function islev_add_portfolio2_modals() { global $islev_portfolio_modals; if ( isset($islev_portfolio_modals) ) { echo $islev_portfolio_modals; } } ?>