Combining WP and WPPA+ search results

To produce a combined display of the normal wp search results and the wppa+ serach results do the following:

  1. Find the file search.php in your theme directory, and bring it in a text editor.
  2. Locate the line:
    <?php if ( have_posts() ) : ?>
    and change it into the next 3 lines:

    <?php $have_photos = function_exists('wppa_have_photos') && wppa_have_photos('450'); ?>
    <?php $have_posts = have_posts(); ?>
    <?php if ( $have_posts || $have_photos ) : ?>

  3. The next action is to find the place where the posts are printed.
    If it is:

    <?php while ( have_posts() ) { : ?>

    change it into:

    <?php if ( $have_posts ) while ( have_posts() ) { : ?>

    and add after the the closing of the while loop:

    if ( $have_photos ) wppa_the_photos();

    (make sure this code is within <?php ?> tags)

    If it is:

    get_template_part( 'loop', 'search' );

    change it into:

    if ( $have_posts ) get_template_part( 'loop', 'search' );
    if ( $have_photos ) wppa_the_photos();


  • The argument '450' in this call: wppa_have_photos('450'); is the column width you want the albums and photos to be displayed. If ommitted, the Column width as defined in Table I-A1 of the Settings page will be used.
    It is the same as size="450" in a shortcode.
  • It is required to have a page assigned to the search results (See Table IX item 2) that contains at least a landing page wppa shortcode ( like [wppa type="landing"][/wppa] )in order to make the links from photos and albums work.
  • A working example (that is used in this site) for the theme twentyten is included in the plugin. See .../wp-content/plugins/wp-photo-album-plus/theme/search.php