Support

Account

Home Forums Front-end Issues Frontend filter pages

Unread

Frontend filter pages

  • Hi there,

    I’ve created a gallery based on WP pages. Aswell created new filter for pages by using ACF radiobutton and it filled it with: sketch, screenshot, art. And I come up with this code

    $field_key = "field_59fc68f725539";
    	$field = get_field_object($field_key);
    
    	if( $field ) {
    		echo '<select id="gallery" class="category"';
    
    		echo '<option value="-1">All</option>';
    
    		foreach( $field['choices'] as $k => $v ) {
    			echo '<option value="' . $k . '"';
    
    			if ( $k == $field ) {
    				echo ' selected';
    			}
    			echo '>' . $v . '</option>';
    		}
    
    		echo '</select>';

    It works fine, but can someone please enlighten me how to make them electable on frontend? I’ve spent lots of time with no luck so far :\ Ideally, I want to let user sort pages of gallery by custom filter.

    Thanks

Viewing 1 post (of 1 total)

The topic ‘Frontend filter pages’ is closed to new replies.