Home › Forums › Space themes support forum › Sticky Reaveal Footer
Sticky Reaveal Footer
- This topic has 9 replies, 2 voices, and was last updated 1 month ago by
Luke Nielsen.
-
AuthorPosts
-
February 18, 2025 at 2:18 pm #639029
sotirisParticipantHi,
1.
I want to create a footer reveal on scroll.
In order to do this I need to increase the Z index of the sections of the site. I tried using a negative Z index for the footer but it wont work. Can you instuct me on how to adjust the Z index of sections that are in the shop page i.e. the Ajax shop element?
2. Is there a way to make Ajax shop “ALL” tab display the products in randor order like in the woodmart theme ?
Regards,
SotirisFebruary 18, 2025 at 4:45 pm #639105
Luke NielsenKeymasterHello,
1. You need to use the CSS property Z-Index and put Position different from Static for the desired selector, for example:
.xts-site-content { position: relative; z-index: 2; } .xts-footer { position: relative; z-index: 1; }
2. Rand products:
if ( ! function_exists( 'xts_random_order_for_products' ) ) { function xts_random_order_for_products( $query ) { if ( ! is_admin() && $query->is_main_query() && ( $query->is_post_type_archive( 'product' ) || $query->is_tax( 'product_cat' ) ) ) { $query->set( 'orderby', 'rand' ); } } add_action( 'pre_get_posts', 'xts_random_order_for_products' ) }
Kind Regards
February 24, 2025 at 1:40 pm #640437
sotirisParticipantHi,
2. What is the correct way to add the code, my attempt resulted in complete failure.Regars,
SotirisFebruary 24, 2025 at 1:50 pm #640445
Luke NielsenKeymasterHello,
2. Paste the code to the functions.php file in your child theme.
Kind Regards
February 24, 2025 at 3:14 pm #640498
sotirisParticipantI get a syntax error. Please advice.
Attachments:
You must be logged in to view attached files.February 24, 2025 at 3:57 pm #640542
Luke NielsenKeymasterHello,
After the
add_action( 'pre_get_posts', 'xts_random_order_for_products' )
you need to define;
the semicolon. Then it will work.We have fixed that on your end, so clear the cache and recheck the issue.
Kind Regards
February 24, 2025 at 4:20 pm #640548
sotirisParticipantThanks, it works but I now get duplicates. I purged all from lightspeed, I cleared cache of Chrome and also from Hostinger. Hostinger also has an “no cache preview” function which also has the duplicates problem.
Attachments:
You must be logged in to view attached files.February 25, 2025 at 12:57 pm #640812
Luke NielsenKeymasterHello,
Please replace the old custom with the below one to make the products random:
if ( ! function_exists( 'xts_random_order_for_products' ) ) { function xts_random_order_for_products( $query ) { if ( ! is_admin() && $query->is_main_query() && ( $query->is_post_type_archive( 'product' ) || $query->is_tax( 'product_cat' ) ) ) { $random_key = get_transient( 'xts_random_order_key' ); if ( false === $random_key ) { $random_key = wp_rand( 1, 1000000 ); set_transient( 'xts_random_order_key', $random_key, HOUR_IN_SECONDS ); } $query->set( 'orderby', 'rand(' . $random_key . ')' ); } } add_action( 'pre_get_posts', 'xts_random_order_for_products' ); }
Kind Regards
February 25, 2025 at 3:28 pm #640875
sotirisParticipantHello,
These got rid of the dublicates. The problem is that it produces exatcly the same result everytime. The products do not change order but are set in a particular order.
I hope I am not asking too much is just that the point of the random order is to see different products first every time.Regards,
SotirisFebruary 25, 2025 at 6:50 pm #640951
Luke NielsenKeymasterHello,
For Shop Page products, it will not work, delete that PHP code and use the Product Tabs element that has a Rand sorting option – https://monosnap.com/file/8GRCykmGxEqMMZ3aZVllqzNM3T7AtF
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register