post_parent ) && $image->post_parent != $id )
$url .= '#main';
return $url;
}
add_filter( 'attachment_link', 'bueno_enhanced_image_navigation', 10, 2 );
/**
* Filters wp_title to print a neat
tag based on what is being viewed.
*/
function bueno_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', 'bueno' ), max( $paged, $page ) );
return $title;
}
add_filter( 'wp_title', 'bueno_wp_title', 10, 2 );
/**
* Show gallery on blog page
*/
function bueno_gallery_sl() {
global $post;
$args = array(
'post_type' => 'attachment',
'post_mime_type' => 'image',
'numberposts' => 20,
'post_status' => null,
'post_parent' => $post->ID,
'orderby' => 'menu_order',
'order' => 'asc'
);
$attachments = get_posts( $args );
?>
ID, false );
?>
-
ID, 'featured-thumb' );
} else {
$gal_image = wp_get_attachment_image( $attachment->ID, 'large-thumb' );
}
if ("" == $gal_image) $gal_image = $cur_url;
?>
ID );
}
if ( ! empty( $meta['image'] ) ) {
$att_id = bueno_img_html_to_post_id( $meta['image'] );
if ( 'one' != of_get_option('blog_page_columns') ) {
$image = wp_get_attachment_image( $att_id, 'featured-thumb' );
} else {
$image = wp_get_attachment_image( $att_id, 'large-thumb' );
}
$cur_url = wp_get_attachment_url( $att_id, false );
} elseif ( has_post_thumbnail() ) {
$post_thumbnail_id = get_post_thumbnail_id();
if ( !is_singular() ) {
if ( 'one' != of_get_option('blog_page_columns') ) {
$image = wp_get_attachment_image( $post_thumbnail_id, 'featured-thumb' );
} else {
$image = wp_get_attachment_image( $post_thumbnail_id, 'large-thumb' );
}
} else {
$image = wp_get_attachment_image( $post_thumbnail_id, 'large-thumb' );
}
$cur_url = wp_get_attachment_url( $post_thumbnail_id, false );
}
if (isset($cur_url)) {
$output = ''.$image.'';
}
}
if ( !isset($output) ) {
return false;
} else {
return $output;
}
}
add_filter( 'bueno_portfolio_args', 'bueno_portfolio_format', 10, 1 );
function bueno_portfolio_format($args) {
$portfolio_format = of_get_option('g_portfolio_format');
$portfolio_format = isset( $portfolio_format ) ? $portfolio_format : "all";
if ( 'images' == $portfolio_format ) {
$args['tax_query'] = array(
array(
'taxonomy' => 'post_format',
'field' => 'slug',
'terms' => array( 'post-format-image' )
)
);
}
return $args;
}
add_filter( 'bueno_portfolio_args', 'bueno_portfolio_cat', 10, 1 );
function bueno_portfolio_cat($args) {
$portfolio_cat = of_get_option('g_portfolio_cat');
$portfolio_cat = isset( $portfolio_cat ) ? $portfolio_cat : "";
if ( '' != $portfolio_cat ) {
$args['category_name'] = esc_attr($portfolio_cat);
}
return $args;
}
function bueno_portfolio_show() {
wp_reset_query();
global $post;
$post_num = get_option( 'posts_per_page' );
$default_args = array(
'posts_per_page' => $post_num,
);
$args = apply_filters( 'bueno_portfolio_args', $default_args );
$count_portf = 0;
$portf_query = new WP_Query( $args );
if ( $portf_query->have_posts() ):
while ( $portf_query->have_posts() ) :
$portf_query->the_post();
if ( has_post_thumbnail() ) {
?>