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

    (@opajaap)

    There is a widget called Search Photos with the subtitle WPPA+ Search Photos.

    On the Photo Albums -> Settings admin page select in Table IX item 2 a page in which the search results have to be displayed. The page should have at least %%wppa%% in its content. Usually one has created a page – like My Album using a wide template (no sidebars) – that contains %%wppa%% only.

    Activate the widget.

    The search alorithm is explained in the FAQ section of the plugins page.

    Thread Starter CBKat

    (@sohkat)

    But I’m not using a sidebar on the gallery so my images can be seen bigger…so therefor I can’t use the Search Widget…is there a way to post it at the top of the photo page or something?

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Try this code in a special template that you use for the display of the photos:

    $page = get_option('wppa_search_linkpage', '0');
    if ($page == '0') {
    _e('Warning. No page defined for search results!', 'wppa');
    }
    else {
    $pagelink = wppa_dbg_url(get_page_link($page));
    ?>
    <form id="wppa_searchform" action="<?php echo($pagelink) ?>" method="post" class="widget_search">
    <div>
    <input type="text" name="wppa-searchstring" id="wppa_s" value="<?php echo($wppa_searchstring) ?>" />
    <input id = "wppa_searchsubmit" type="submit" value="<?php _e('Search', 'wppa'); ?>" />
    </div>
    </form>
    <?php
    }
    Thread Starter CBKat

    (@sohkat)

    I’m sorry, I’m not entirely sure just which file in my custom template to place this in

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    what theme do you use?

    Thread Starter CBKat

    (@sohkat)

    Its the Options Theme which is discontinued, but its the subtemplate of that called Shadow which I use.

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Cant find the theme. If you mail me the template ( opajaap at opajaap.nl ) i will modify it for you.

    Thread Starter CBKat

    (@sohkat)

    Will do thank you 🙂

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    If you can not find the file, here is how to:

    On the wp edit page screen there is a selection box in the right hand sidebar where you can select the page template to be used for the page you are editing. It is in the Page Attributes section: Page Template.
    Decide what template you want to modify.

    In your theme directory there are many .php files, also the page templates, but the names need not to be the same as the template you are looking for. You should look for the file that has in its header:

    * Template Name: .......

    as in onecolumn-page.php of the theme twentyten:

    <?php
    /**
     * Template Name: One column, no sidebar
     *
     * A custom page template without sidebar.
     *
     * The "Template Name:" bit above allows this to be selectable
     * from a dropdown menu on the edit page screen.
     *
     * @package WordPress
     * @subpackage Twenty_Ten
     * @since Twenty Ten 1.0
     */

    Once you found the file with the desired Template Name: you’ve got him.

    You can insert

    <?php
    	/* Display the search field */
    	global $wppa;
    		if ( !isset($wppa['searchstring']) ) $wppa['searchstring'] = '';
    		$page = get_option('wppa_search_linkpage', '0');
    		if ($page == '0') {
    			_e('Warning. No page defined for search results!', 'wppa');
    		}
    		else {
    			if ( function_exists('wppa_dbg_url') ) $pagelink = wppa_dbg_url(get_page_link($page));
    			else $pagelink = get_page_link($page);
    ?>
    			<form id="wppa_searchform" action="<?php echo($pagelink) ?>" method="post" class="widget_search">
    				<div>
    					<input type="text" name="wppa-searchstring" id="wppa_s" value="<?php echo $wppa['searchstring'] ?>" />
    					<input id = "wppa_searchsubmit" type="submit" value="<?php _e('Search', 'wppa_theme'); ?>" />
    				</div>
    			</form>
    <?php
    		}
    ?>

    just before <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?> or something the like, it should be in any template.

    Thread Starter CBKat

    (@sohkat)

    I’m so so so sorry its taken me awhile to get back to you about this. I’ve had family emergencies going on so I’ve only been able to do this now. Thank you so much for taking time out to help me with this.

    I tried as you posted above, and it does work, but I do have one issue. I’m using it on a “no sidebar” page. And while it works exactly as I want I have two issues.

    One – I have a “Store” and that has no sidebar, so the searchbar shows up there too. Is there a way to only have it show up on the Gallery page and not other pages that use the “no sidebar” template?

    Two – If #1 can be done, how do I edit the size of the search box and input button? One is too large.

    Thanks so much!

    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    You could try this:

    <?php
    $want_searchbar_on_page = '1234'; // assume 1234 is page id where you want the searbar on
    $this_page = get_page();
    
    if ($this_page->ID == $want_searchbar_on_page) {
    .
    .
    .
    the searchbar code
    .
    .
    }
    ?>

    The layout is defined by your themes css.
    If you supply a link to your site (and isnstructions to get on the page involved) i can give you detailed instructions.

    Thread Starter CBKat

    (@sohkat)

    I saw your other post about how to make it so that photos are included with the regular WordPress search. Sounds like I should just go about doing it like that. But I notice a lot of the code I need to switch isn’t in my template and I’m not sure how to go about it.

    Here is a link to my gallery
    http://halloween.shiversofhorror.com/blog/multimedia/photo-gallery

    Thread Starter CBKat

    (@sohkat)

    Didn’t notice this was marked as resolved. Still looking for help on my previous post.

    I’m using the Options theme, Shadow subtemplate. The theme is not available for download anymore so I’m reposting the code here for help as I can’t find any of the items in the directions ( http://wppa.opajaap.nl/?p=1518 ) to change:

    <?php get_header(); ?>
    
    <div class="post">
    	<h2 class="section-header"><?php _e('Search Results','options'); ?></h2>
    	<div class="entry">
    		<p>
    			<?php _e('You are browsing the search results for','options');  ?>
    			"<?php the_search_query(); ?>."
    		</p>
    	</div>
    </div>
    
    <?php if(have_posts()) : while(have_posts()) : the_post(); ?>
    
    	<div class="post">
    
    		<?php echo get_the_image_link(array('Thumbnail'), 'thumbnail'); ?>
    
    		<h3 class="post-title">
    			<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    		</h3>
    
    		<div class="entry">
    			<?php the_excerpt(); ?>
    		</div>
    	</div>
    
    	<?php endwhile; ?>
    
    	<?php op_after_archive(); // After archive hook ?>
    
    <?php else: ?>
    
    	<p><?php _e('Sorry, no posts matched your criteria.','options'); ?></p>
    
    <?php endif; ?>
    
    <?php get_footer(); ?>
    Plugin Author Jacob N. Breetvelt

    (@opajaap)

    Could not test it of course, but this should work:

    <?php get_header(); ?>
    
        <div class="post">
        	<h2 class="section-header"><?php _e('Search Results','options'); ?></h2>
        	<div class="entry">
        		<p>
        			<?php _e('You are browsing the search results for','options');  ?>
        			"<?php the_search_query(); ?>."
        		</p>
        	</div>
        </div>
    
    	<?php $have_photos = function_exists('wppa_have_photos') && wppa_have_photos('450'); ?>
    	<?php $have_posts  = have_posts(); ?>
    	<?php if ( $have_posts || $have_photos ) : ?>
    
    		<?php if ( $have_posts ) : while(have_posts()) : the_post(); ?>
    
    			<div class="post">
    
    				<?php echo get_the_image_link(array('Thumbnail'), 'thumbnail'); ?>
    
    				<h3 class="post-title">
    					<a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
    				</h3>
    
    				<div class="entry">
    					<?php the_excerpt(); ?>
    				</div>
    			</div>
    
    		<?php endwhile; ?>
    
    		<?php if ( $have_potos ) wppa_the_photos();
    
        	<?php op_after_archive(); // After archive hook ?>
    
        <?php else: ?>
    
        	<p><?php _e('Sorry, no posts or photos matched your criteria.','options'); ?></p>
    
        <?php endif; ?>
    
        <?php get_footer(); ?>
Viewing 14 replies - 1 through 14 (of 14 total)
  • The topic ‘[Plugin: WP Photo Album Plus] Confused about Searching Gallery’ is closed to new replies.