Skip to:
Content
Pages
Categories
Search
Top
Bottom

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 .= "



    $output_links



    $output_paging

    n";

    return $output;
    }



Viewing 8 replies - 1 through 8 (of 8 total)
  • That’s a tough-one! :p

    I had a quick look by trying to recreate your function, but could never get the function to fully work, and when querying what post type was being displayed when using your function, it said post, and the post had a map position somehow. Am sure it has something to do with the content filters, but there is little I can do without knowing exactly what the problem is.

    If you manage to isolate the problem, I may be able to help…

    hi mark,
    definitely seems to be something with the content filter. i’ve removed my slideshow for the moment so i can get the site up.

    thanks for looking in and for the great plugin. much appreciated.

    lupark

    having some trouble getting the place_id=”all” to show a map, googles passing a bad request to this url:
    http://maps.google.com/maps/api/js/StaticMapService.GetMapImage?1m2&1iNaN&2iNaN&2e1&3u13&4m2&1uNaN&2uNaN&5m3&1e0&2b1&5sen-GB&token=63033

    just found a – echo ‘here?’ – in gpress-shortcodes.php line 323

    Oops…

    So sorry about the “echo here” problem – must have forgotten to take it out after testing – my bad.

    Will upload a new version in a short while after reading through the other support tickets to see if there is anything else I can fix before I upload…

    After we have that fixed, let’s look again at your problem…

    not to worry. it’s not a fault. i hadn’t added any ‘places’ only tagged posts with locations. didn’t realise that posts weren’t included in the place_id=”all” shortcode.

    i’ve circumvented the initial problem with the clashing function so if you’d like to resolve the filter issue i can setup it up on another domain so you can play with it. just let me know.

    If you have the time and interest to set-up a test bed for me, I’d be happy to take a look – and would usually do this kind of thing at the weekend, which is my proper gPress time – but am going away this weekend for some much needed family time – but if you want to set up and liaise with me regarding details, I will try to look at it the following weekend…

    no probs. will set it up shortly and send you deets.

    Am hoping this has been resolved with gPress 0.2.5 as we have spent a LOT of effort on improving the_content filters – http://gpress.my/documentation/ – please let me know how the upgrade goes…

Viewing 8 replies - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.