Dynamic “home” image and URL based on current folder

You might want to consider setting things up as a subfolder-based MultiSite. You would then have www.example.com as the top-level site, with www.example.com/brand1 and www.example.com/brand2 subsites where you would be able to set separate logos and navigation. If separate navigation isn’t your goal, i.e. you want it to be easier for people to move between … Read more

Set notification if is two product category in cart

Quickly, I thought about that : (but it’s not my best! Maybe I’ll come rewrite a more thoughtful code sometimes but for now, this code’ll work) add_action( ‘woocommerce_before_cart’, ‘webroom_check_if_product_category_is_in_cart’ ); function webroom_check_if_product_category_is_in_cart() { $cat1_in_cart = false; $cat2_in_cart = false; foreach ( WC()->cart->get_cart() as $cart_item_key => $cart_item ) { if ( has_term( ‘cat1’, ‘product_cat’, $cart_item[‘product_id’] ) … Read more

How can i show specific Category List?

<?php // change category to your custom page slug $categories = get_categories( array( ‘include’ => array(1, 2, 3) ) ); foreach ($categories as $category) { $option .= ‘<option value=”‘.get_option(‘home’).’/category/’.$category->slug.'”>’; $option .= $category->cat_name; $option .= ‘ (‘.$category->category_count.’)’; $option .= ‘</option>’; } echo $option; ?> array(1, 2, 3) is category ids.

Need to show 7 posts from actual date

Try this static function loop_args($parent_id, $number) { $today = getdate(); $args = [ ‘cat’ => $parent_id, ‘showposts’ => ‘7’, ‘orderby’ => ‘ID’, ‘order’ => ‘asc’, ‘date_query’ => array( array( ‘year’ => $today[“year”], ‘month’ => $today[“mon”], ‘day’ => $today[“mday”], ), ), ]; return $args; }

Fetch commens from a specific post

This will allow you pull the comments of a post via the id and then edit the returned content info of the post. You will be required to add your CSS and html to style the comments. $args = array( ‘author_email’ => ”, ‘author__in’ => ”, ‘author__not_in’ => ”, ‘include_unapproved’ => ”, ‘fields’ => ”, … Read more