broken layout
-
Having a problem with the map rendering in the place where I have a slideshow function thats being called like this:
$gallery_shortcode = '[mygallery]';
print apply_filters( 'the_content', '[mygallery]' );
The function I’m calling is a modified version of the internal wp gallery function. When the page loads gpress is dropping the map into the space where I have the gallery and the map box in the post remains empty. If I remove the above code gpress sits in place and functions fine.
I guess it could it be my function and not gpress so I’ve posted my functions code below also:
add_shortcode('mygallery', 'my_gallery_shortcode');
function my_gallery_shortcode($null, $attr = array( )) {
global $post, $wp_locale;
static $instance = 0;
$instance++;
// We're trusting author input, so let's at least make sure it looks like a valid orderby statement
if ( isset( $attr ) ) {
$attr = sanitize_sql_orderby( $attr );
if ( !$attr )
unset( $attr );
}
extract(shortcode_atts(array(
'order' => 'ASC',
'orderby' => 'menu_order ID',
'id' => $post->ID,
'size' => 'large',
'include' => '',
'exclude' => ''
), $attr));
$id = intval($id);
if ( 'RAND' == $order )
$orderby = 'none';
if ( !empty($include) ) {
$include = preg_replace( '/[^0-9,]+/', '', $include );
$_attachments = get_posts( array('include' => $include, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
$attachments = array();
foreach ( $_attachments as $key => $val ) {
$attachments[$val->ID] = $_attachments[$key];
}
} elseif ( !empty($exclude) ) {
$exclude = preg_replace( '/[^0-9,]+/', '', $exclude );
$attachments = get_children( array('post_parent' => $id, 'exclude' => $exclude, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
} else {
$attachments = get_children( array('post_parent' => $id, 'post_status' => 'inherit', 'post_type' => 'attachment', 'post_mime_type' => 'image', 'order' => $order, 'orderby' => $orderby) );
}
if ( empty($attachments) )
return '';
if ( is_feed() ) {
$output = "n";
foreach ( $attachments as $att_id => $attachment )
$output .= wp_get_attachment_link($att_id, $size, true) . "n";
return $output;
}
$i = 0;
foreach ( $attachments as $id => $attachment ) {
$link = wp_get_attachment_image($id, $size, false);
$i++;
$output_links .= "
$link";
$output_paging .= "
$i";
}
$output .= "
n";
$output_links
$output_paging
return $output;
}
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
You must be logged in to reply to this topic.