Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Zetona

    (@zetona)

    I just tried to copy the content of job-filter-job-types.php after the custom search form code in my template.

    <?php if ( ! is_tax( 'job_listing_type' ) && empty( $job_types ) ) : ?>
    	<ul class="job_types">
    		<?php foreach ( get_job_listing_types() as $type ) : ?>
    			<li><label for="job_type_<?php echo $type->slug; ?>" class="<?php echo sanitize_title( $type->name ); ?>"><input type="checkbox" name="filter_job_type[]" value="<?php echo $type->slug; ?>" <?php checked( in_array( $type->slug, $selected_job_types ), true ); ?> id="job_type_<?php echo $type->slug; ?>" /> <?php echo $type->name; ?></label></li>
    		<?php endforeach; ?>
    	</ul>
    	<input type="hidden" name="filter_job_type[]" value="" />
    <?php elseif ( $job_types ) : ?>
    	<?php foreach ( $job_types as $job_type ) : ?>
    		<input type="hidden" name="filter_job_type[]" value="<?php echo sanitize_title( $job_type ); ?>" />
    	<?php endforeach; ?>
    <?php endif; ?>

    This gives an error for each checkbox:
    Warning: in_array() expects parameter 2 to be array, null given in /wp-content/themes/child/page_jobs.php on line 55
    id=”job_type_test” /> test

    Plugin Contributor Davor

    (@davoraltman)

    Hey @zetona,

    Are you still having trouble with this? Can you provide me with the URL of your site so that I can take a look?

    Thanks,
    Davor

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Custom search form with Checkboxes?’ is closed to new replies.