Forum Replies Created

Viewing 12 replies - 1 through 12 (of 12 total)
  • mel2007

    (@mel2007)

    Have anybody tried using the “All in One SEO Pack” to search? The developer posted something about it on his site.

    http://pento.net/2010/03/10/job-manager-highlight-bluetree-search/

    Does anybody know how they did this?
    http://thesentiogroup.com/jobs/

    Ok, How do I post it on a page? Is “bloginfo” pointing to a specific page templete or what? I want to post the search before the job listings or have the search on another page.

    Does it matter where I post this in the functions.php file?
    So you made a separate .js file and that just goes in my specific theme folder that I’m using, right?

    Which php page did you put the code in?

    Maybe have it search upon looping?

    It doesn’t turn up any search results.

    Should I remove the loop as well? It keeps looping the job title and search.

    I got it to work but it doesn’t search for all of the listings, only one shows up.
    Below is my code, also the website (http://project.job1usa.com/test/) is what I’m testing on so feel free to test it out for yourself.

    <?php
    /*
    Template Name: Advanced Search
    */
    ?>
    <?php $options = get_option( 'classy_theme_settings' ); ?>
    <?php get_header(''); ?>
    <?php
    //start loop
    if (have_posts()) : while (have_posts()) : the_post();
    //get featured image
    $featured_image = wp_get_attachment_image_src(get_post_thumbnail_id(), 'page-header' );
    ?>
    <?php
    //if post has thumbnail
    if( has_post_thumbnail() ) { ?>
    <div id="page-header">
    <img src="<?php echo $featured_image[0]; ?>" alt ="<?php the_title(''); ?>" width="980" />
    </div>
    <!-- END #page-header -->
    <?php } ?>
    <div id="post">
        <h1 class="page-title"><?php the_title(); ?></h1>
        <?php the_content(); ?>
        <?php
    	if(!isset($_GET['keyword'])){$_GET['keyword']="";}
    	if(!isset($_GET['location'])){$_GET['location']=0;}
    ?>
        <form action="#" methond="get">
        <ul>
        	<li>
        		<label for="keyword">Keyword</label>
        		<input type="text" name="keyword" value="<?php echo strip_tags($_GET['keyword']); ?>" />
        	</li>
        	<li>
        		<label for="location">Location</label>
    			<select name="location">
    			<option value="0"<?php if($_GET['location']==0){?> selected="selected"<?php } ?>>Any</option>
    			<option value="1"<?php if($_GET['location']==1){?> selected="selected"<?php } ?>>Toledo, OH</option>
    			<option value="2"<?php if($_GET['location']==2){?> selected="selected"<?php } ?>>Delta, OH</option>
    			<option value="3"<?php if($_GET['location']==3){?> selected="selected"<?php } ?>>Findlay, OH</option>
    		</select>
    		</li>
    	<input type="submit" value="Search" />
    	</ul>
    </form>
    <?php if($_GET['keyword']!=""||$_GET['salary']!=0||$_GET['location']!=0){ ?>
    	<h2>Search Results</h2>
    	<ul id="jobs-two">
    		<?php //query_posts('post_type=jobman_job&posts_per_page=10'); ?>
    		<?php
    		$_GET['keyword'] = trim($_GET['keyword']);
    		if($_GET['keyword']==""){$_GET['keyword']=" ";}
    		if($_GET['location']!=0){
    			switch($_GET['location']){
    				case 1:
    					$location = 'Toledo, OH';
    					break;
    				case 2:
    					$location = 'Delta, OH';
    					break;
    				case 3:
    					$location = 'Findlay, OH';
    					break;
    			}
    		}
    		if($_GET['location']!=0){
    			query_posts(array(
    				'post_title' => 'LIKE %'.$_GET['keyword'].'%',
    				'post_type' => 'jobman_job',
    				'meta_query' => array(
    					array(
    						'key' => 'data4',
    						'value' => $location,
    					),
    				),
    				'posts_per_page' => '10',
    			));
    		}
    		elseif($_GET['location']!=0){
    			query_posts(array(
    				'post_title' => 'LIKE %'.$_GET['keyword'].'%',
    				'post_type' => 'jobman_job',
    				'meta_query' => array(
    					array(
    						'key' => 'data4',
    						'value' => $location,
    					),
    				),
    				'posts_per_page' => '10',
    			));
    		}else{
    			query_posts(array(
    				'post_title' => 'LIKE %'.$_GET['keyword'].'%',
    				'post_type' => 'jobman_job',
    				'posts_per_page' => '10',
    			));
    		}
    		?>
    		<?php $count = 0; ?>
    		<?php while (have_posts()) : the_post(); ?>
    		<?php if(strstr(get_the_title(),trim($_GET['keyword']))){ ?>
    		<li>
    			<strong><?php the_title(); ?></strong><br />
    			<strong>Location:</strong> <?php $location = get_post_custom_values('data4'); echo $location[0]; ?><br />
    			<a href="<?php the_permalink() ?>">More</a>
    		</li>
    		<?php $count++; ?>
    		<?php } ?>
    		<?php endwhile;?>
    		<?php if(!$count){ ?>
    		<p><strong>Sorry but your search returned no jobs. Please try again.</strong></p>
    		<?php } ?>
    	</ul>
    <?php } ?>
    
        <?php comments_template(); ?>
    </div>
    <!-- END post-content -->
    <?php endwhile; ?>
    <?php endif; ?>
    <?php get_sidebar('pages'); ?>
    <?php get_footer(''); ?>

    I took out the salary section since I didn’t need it.

    Did you get time to do the tutorial? I was just wondering.

    Yay!! I would greatly appreciate that. I’m working on a client project that want to search for job locations because they will have a lot of postings. Could that be implemented into a simple widget?

    I am interested in a more in-depth tutorial how you did it. I know basic PHP and I am just beginning to understand WordPress.

    Where should I post that code, Ed?

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