Title: Special PHP Code no longer works
Last modified: January 7, 2017

---

# Special PHP Code no longer works

 *  Resolved [pfm](https://wordpress.org/support/users/pfm/)
 * (@pfm)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/special-php-code-no-longer-works/)
 * 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](https://wordpress.org/support/users/opajaap/)
 * (@opajaap)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/special-php-code-no-longer-works/#post-8630616)
 * 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.'`
    -  This reply was modified 9 years, 5 months ago by [Jacob N. Breetvelt](https://wordpress.org/support/users/opajaap/).
 *  Thread Starter [pfm](https://wordpress.org/support/users/pfm/)
 * (@pfm)
 * [9 years, 5 months ago](https://wordpress.org/support/topic/special-php-code-no-longer-works/#post-8630785)
 * 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.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-photo-album-plus.svg)
 * [WP Photo Album Plus](https://wordpress.org/plugins/wp-photo-album-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-photo-album-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-photo-album-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-photo-album-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-photo-album-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-photo-album-plus/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [pfm](https://wordpress.org/support/users/pfm/)
 * Last activity: [9 years, 5 months ago](https://wordpress.org/support/topic/special-php-code-no-longer-works/#post-8630785)
 * Status: resolved