Make WooCommerce product categories only show images on homepage

Try running your function hooked into the template_redirect action like so: <?php function fp_categories() { if( is_front_page() ) { add_action( ‘woocommerce_before_subcategory_title’, ‘woocommerce_subcategory_thumbnail’, 10 ) ; } else { remove_action( ‘woocommerce_before_subcategory_title’, ‘woocommerce_subcategory_thumbnail’, 10 ) ; } } add_action( ‘template_redirect’, ‘fp_categories’ ); ?> I’m fuzzy on the logic why this works – I believe otherwise the functions … Read more

Hiding New Posts on Front Page

You could try do something similar to the code you have tried, but using the before argument instead of the after: $query->set( ‘date_query’, array( array( ‘before’ => ‘-1 day’, ) ) ); This way, you should get only posts published before 1 day ago.

Homepage not working after setting as frontpage

Try going to the Settings Panel, and then changing the Permalink structure to any other. After this, try changing back to the original setting. This can be some problem with the rewrite rules made by the theme when the base structure is changed.

Swap home page based on user role, Elementor layout breaking

I do believe I’ve got it. Here’s the code: // Display different home page for dealer vs consumer if( is_user_logged_in() ) { $current_user = wp_get_current_user(); $user = new WP_User($current_user -> ID); if (in_array(‘Wholesale’, $user->roles)){ $page = get_post(2885); update_option( ‘page_on_front’, $page->ID ); update_option( ‘show_on_front’, ‘page’ ); } else { $page = get_post(2847); update_option( ‘page_on_front’, $page->ID ); … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)