post_content ) && isset( $menu_item->description ) ) { $menu_item->description = apply_filters( 'nav_menu_description', $menu_item->post_content ); } return $menu_item; } //Change content width variable according to current template add_filter( 'template_redirect', 'antreas_content_width_size' ); function antreas_content_width_size( $size ) { if ( is_page_template( 'template-full.php' ) || is_page_template( 'template-blank.php' ) ) { global $content_width; $content_width = 980; } } //Turn off inline styles for gallery shortcode add_filter( 'use_default_gallery_style', '__return_false' ); //Turn off styles in Recent Comments widget if ( ! function_exists( 'antreas_remove_recent_comments_style' ) ) { add_action( 'widgets_init', 'antreas_remove_recent_comments_style' ); function antreas_remove_recent_comments_style() { add_filter( 'show_recent_comments_widget_style', '__return_false' ); } } if ( ! function_exists( 'antreas_gallery_lightbox' ) ) { add_filter( 'wp_get_attachment_link', 'antreas_gallery_lightbox', 10, 4 ); function antreas_gallery_lightbox( $link, $id, $size, $permalink ) { global $post; wp_enqueue_style( 'antreas-magnific' ); wp_enqueue_script( 'antreas-magnific' ); if ( ! $permalink ) { $link = str_replace( 'ID ) ) { $classes[] = 'post-has-thumbnail'; } return $classes; } } //Add portfolio thumbnail size to WordPress admin add_action( 'admin_init', 'antreas_thumbnail_settings' ); if ( ! function_exists( 'antreas_thumbnail_settings' ) ) { function antreas_thumbnail_settings() { $option_values = get_option( 'antreas_thumbnail' ); $default_values = array( 'width' => ANTREAS_THUMBNAIL_WIDTH, 'height' => ANTREAS_THUMBNAIL_HEIGHT, ); $data = shortcode_atts( $default_values, $option_values ); register_setting( 'media', 'antreas_thumbnail' ); add_settings_field( 'antreas_portfolio_thumbnails', __( 'Portfolio Size', 'antreas' ), 'antreas_thumbnail_fields', 'media', 'default', $data ); } } //Print fields for managing thumbnail sizes if ( ! function_exists( 'antreas_thumbnail_fields' ) ) { function antreas_thumbnail_fields( $args ) { ?> __( 'Portfolio Size', 'antreas' ) ) ); } } //Add a wrapper to embeds so they become responsive add_filter( 'embed_oembed_html', 'antreas_embed_wrapper', 10, 3 ); add_filter( 'video_embed_html', 'antreas_embed_wrapper' ); function antreas_embed_wrapper( $html ) { if ( strstr( $html, 'youtube.com' ) != false || strstr( $html, 'vimeo.com' ) != false || strstr( $html, 'wordpress.tv' ) != false ) { return '
' . $html . '
'; } else { return $html; } }