Quantcast
Channel: WordPress.org Forums » All Topics
Viewing all articles
Browse latest Browse all 67836

Sort by not show

$
0
0

Replies: 0

Sort by not showing in brand page.

notshowsortoderby

how to display value

this is my code

if ( ! defined( ‘ABSPATH’ ) ) {
exit; // Exit if accessed directly
}
// Keep query string vars intact
foreach ( $_GET as $key => $val ) {
if ( ‘orderby’ === $key || ‘submit’ === $key ) {
continue;
}
if ( is_array( $val ) ) {
foreach( $val as $innerVal ) {
echo ‘<input type=”hidden” name=”‘ . esc_attr( $key ) . ‘[]” value=”‘ . esc_attr( $innerVal ) . ‘” />’;
}
} else {
echo ‘<input type=”hidden” name=”‘ . esc_attr( $key ) . ‘” value=”‘ . esc_attr( $val ) . ‘” />’;
}
}
echo ‘<form class=”woocommerce-ordering” method=”get”>’;
echo ‘<select name=”orderby” class=”orderby”>’;
foreach ( $catalog_orderby_options as $id => $name ) {
echo ‘<option value=”<?php echo esc_attr( $id ); ?>” <?php selected( $orderby, $id ); ?>><?php echo esc_html( $name ); ?></option>’;
}
echo ‘</select>’;
echo ‘</form>’;


Viewing all articles
Browse latest Browse all 67836

Trending Articles