Accept Unlimited Argument In a PHP Function
*** Accepting unlimited argument in a function is a new feature of PHP 7
*** Accepting unlimited argument in a function is a new feature of PHP 7
***Fix the return type of a function in order to avoid errors.
#Main PHP File #Functions PHP File ***Important Notes: You cannot write the code like this If you give a default value to one parameter, you have to do it for the other
In order to do that we have to call “wp_get_attachment_image_src” function. we can just slightly modify the previous code. ***Display Woocommerce Categories With Thumbnails #MODIFIED CODE EXAMPLE
In order to show the custom fields data we have to follow the code example given below. #CODE EXAMPLE
*In PHP there are two string operators. 1.Concatenation Operator (‘.’) It returns the concatenation of its right and left arguments 2.concatenating assignment operator (‘.=’) It appends the argument on the right side
In order to hide some category from a Woocommerce query, we can use ACF to do that. *Let’s get started. Simple query to display product categories with thumbnails. This a simple query
Add this code on your php file or theme file where you wanna show the Woo-commerce product categories with thumbnail. #CODE EXAMPLE
Create an Option page from functions.php. Add this code in functions.php file #CODE EXAMPLE ***While creating the image custom field for the Option Page, Your Image Return Format should be set as
1. Go to your project in google cloud platform 2. Then go to Computer Engine-> VM instances -> project name https://i.postimg.cc/8zgbR2zL/google-cloud.png 3. Then Click On SSH https://i.postimg.cc/q7kXY2nR/google-cloud-2.png 4. It will open in
Main code snippet you can use in product loop. For single product page you can just echo this code