Teşekkür ederim
@Empat; fakat tek kelime çevirisi için eklenti kurmak istemedim.
@SemihC; teşekkür ederim yardımlarından dolayı. Tema dosyasının Child temasında, function.php içerisinde kod yazarak çözdük.
gerekli olur veya birileri electro temasında kullanır diye kodu bırakıyorum.
Kullanmak isterseniz, kodlar içerisindeki "
1Değişen1" değerini orada yazmasını istediğiniz değer ile değiştirmeniz gerekir. if ( ! function_exists( 'electro_wc_products_per_page' ) ) {
/**
* Outputs a dropdown for user to select how many products to show per page
*/
function electro_wc_products_per_page() {
global $wp_query;
$action = '';
$cat = '';
$cat = $wp_query->get_queried_object();
$method = apply_filters( 'electro_wc_ppp_method', 'post' );
$return_to_first = apply_filters( 'electro_wc_ppp_return_to_first', false );
$total = $wp_query->found_posts;
$per_page = $wp_query->get( 'posts_per_page' );
$_per_page = electro_set_loop_shop_columns() * 4;
// Generate per page options
$products_per_page_options = array();
while( $_per_page < $total ) {
$products_per_page_options[] = $_per_page;
$_per_page = $_per_page * 2;
}
if ( empty( $products_per_page_options ) ) {
return;
}
$products_per_page_options[] = -1;
// Set action url if option behaviour is true
// Paste QUERY string after for filter and orderby support
$query_string = ! empty( $_SERVER['QUERY_STRING'] ) ? '?' . add_query_arg( array( 'ppp' => false ), $_SERVER['QUERY_STRING'] ) : null;
if ( isset( $cat->term_id ) && isset( $cat->taxonomy ) && $return_to_first ) :
$action = get_term_link( $cat->term_id, $cat->taxonomy ) . $query_string;
elseif ( $return_to_first ) :
$action = get_permalink( wc_get_page_id( 'shop' ) ) . $query_string;
endif;
// Only show on product categories
if ( ! woocommerce_products_will_display() ) :
return;
endif;
do_action( 'electro_wc_ppp_before_dropdown_form' );
?><form method="POST" action="<?php echo esc_url( $action ); ?>" class="form-electro-wc-ppp"><?php
do_action( 'electro_wc_ppp_before_dropdown' );
?><select name="ppp" onchange="this.form.submit()" class="electro-wc-wppp-select c-select"><?php
$products_per_page_options = array_slice( $products_per_page_options, 0, 4 );
foreach( $products_per_page_options as $key => $value ) :
?>
<option value="<?php echo esc_attr( $value ); ?>" <?php selected( $value, $per_page ); ?>>
<?php
$ppp_text = apply_filters( 'electro_wc_ppp_text', __( '1Değişen1 %s', 'electro' ), $value );
esc_html( printf( $ppp_text, $value == -1 ? __( 'All', 'electro' ) : $value ) ); // Set to 'All' when value is -1
?>
</option>
<?php
endforeach;
?></select><?php
// Keep query string vars intact
foreach ( $_GET as $key => $val ) :
if ( 'ppp' === $key || 'submit' === $key ) :
continue;
endif;
if ( is_array( $val ) ) :
foreach( $val as $inner_val ) :
?><input type="hidden" name="<?php echo esc_attr( $key ); ?>[]" value="<?php echo esc_attr( $inner_val ); ?>" /><?php
endforeach;
else :
?><input type="hidden" name="<?php echo esc_attr( $key ); ?>" value="<?php echo esc_attr( $val ); ?>" /><?php
endif;
endforeach;
do_action( 'electro_wc_ppp_after_dropdown' );
?></form><?php
do_action( 'electro_wc_ppp_after_dropdown_form' );
}
}