Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hello,

    Thank you very much for your plugin, it is really great!

    I recently tried to switch from php 7.4 to php 8.0 but I have an error message that appears on my website:

    Link_Juice_Optimizer_Public::{closure}(): Argument #2 ($key) must be passed by reference, value given in /wp-content/plugins/link-juice-optimizer/public/class-link-juice-optimizer-public.php on line 617

    I also tried with version 8.1 & 8.2. I also have the same error message.
    It works well with php 7.4

    Apache server
    PHP 8.0 (8.1 & 8.2)
    MariaDB 10.4
    WordPress 6.1.1

    Can you please confirm/comment or suggest something about this problem ?

    Kind regards,

    Sebastien

    Thread Starter sebastienfry

    (@sebastienfry)

    I’d like to remove the loop on some category product page.
    My goal is to customize category product page with gutenberg block.
    I already know how to add description before and/or after products loop.
    Now I’d also like to remove all the products on the category product page (but only in one or two category, not all category product page).

    For exemple, this snippet is to remove all the products from shop page.
    I need the same for category product page :

    add_action( 'pre_get_posts', 'stuff_remove_products_from_shop_page' );
    function stuff_remove_products_from_shop_page( $q ) {
       if ( ! $q->is_main_query() ) return;
       if ( ! $q->is_post_type_archive() ) return;
       if ( ! is_admin() && is_shop() ) {
          $q->set( 'post__in', array(0) );
       }
       remove_action( 'pre_get_posts', 'stuff_remove_products_from_shop_page' );
Viewing 2 replies - 1 through 2 (of 2 total)