• Resolved pfm

    (@pfm)


    There is some special code I use for showing pictures on my /tag/ sites. This was originally created by you:

    <?php if ( function_exists( 'wppa_albums' ) ) {
    
    // Init
    global $wppa;
    global $thumbs;
    global $photo_count;
    
    // Find the tag
    $my_tag = wppa_sanitize_tags( single_tag_title( '', false ) );
    
    // Find the count of photos
    $wppa['is_tag'] = $my_tag;
    wppa_get_thumbs();
    $photo_count = is_array( $thumbs ) ? count( $thumbs ) : 0;
    
    // If photos, show them
    if ( $photo_count ) {
    echo '<h2 class="entry-title"><b>Galerie-Fotos</b> - passend zu dem Artikel-Schlagwort</h2>';
    echo '</br>';
    		
    //echo do_shortcode( '[wppa type="slide" album="#tags,'.$my_tag.' size="auto" align="center"][/wppa]' );
    echo wppa_insert_shortcode_output( do_shortcode( '[wppa type="thumbs" album="#tags,'.$my_tag.' size="auto" align="center"][/wppa]' ) );
    }
    
    // If no photos, say it and clean up !
    else {
    //echo 'Es gibt leider keine passenden Fotos mit dem Schlagwort <b>'.$my_tag.'</b>';
    wppa_reset_occurrance();
    }
    echo '</br>';
    } ?>

    I don’t know when it stopped working. If I add the shortcode in an empty page it works
    using [wppa type="thumbs" album="#tags, ardbeg" size="auto" align="center"][/wppa]

    But not with the above code
    https://fosm.de/tag/ardbeg/

    This code seems to don’t find any pics with the tags. Was there a change with the used functions? Any help is appreciated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Jacob N. Breetvelt

    (@opajaap)

    I recently fixed a missing initialisation. I think this causes the ‘problem’. The real problem is a typo in

    
    echo wppa_insert_shortcode_output( do_shortcode( '[wppa type="thumbs" album="#tags,'.$my_tag.' size="auto" align="center"][/wppa]' ) );
    

    It misses a double quote, it should read:

    
    echo wppa_insert_shortcode_output( do_shortcode( '[wppa type="thumbs" album="#tags,'.$my_tag.'" size="auto" align="center"][/wppa]' ) );
    

    i.e. a " right after '.$my_tag.'

    Thread Starter pfm

    (@pfm)

    Thank you! Works again! Looks much better with thumbs.

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

The topic ‘Special PHP Code no longer works’ is closed to new replies.