ACF Gallery field images donwload

I’m using this same code and I was able to figure out where the error’s happening. The path that gets generated when this line of code is called is wrong: $zip->open( $destination, ZipArchive::CREATE ); It spits out your home directory and then appends the value of $destination to it. In my case (it’s not the … Read more

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

Block plugin update possibilities (but not by hiding notifications)

Try this: add_filter( ‘http_request_args’, ‘dm_prevent_update_check’, 10, 2 ); function dm_prevent_update_check( $r, $url ) { if ( 0 === strpos( $url, ‘http://api.wordpress.org/plugins/update-check/’ ) ) { $my_plugin = plugin_basename( __FILE__ ); $plugins = unserialize( $r[‘body’][‘plugins’] ); unset( $plugins->plugins[$my_plugin] ); unset( $plugins->active[array_search( $my_plugin, $plugins->active )] ); $r[‘body’][‘plugins’] = serialize( $plugins ); } return $r; } Credits: https://stackoverflow.com/questions/17897044/wordpress-how-to-disable-plugin-update

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; }