SQL order by fields
SELECT * FROM wp_posts WHERE ID IN (5,26,4) ORDER BY FIELD(ID,5,26,4)
Change WordPress default email notification. Mostly used in new user registration, the default is `WordPress <wordpress@yourdomain.com>`. In my case I want to change the WordPress Name to my domain name. The output will be `Anthony Carbon <info@anthonypagaycarbon.com>`. The codes below will complete your tasks. add_filter( ‘wp_mail_from’, ‘default_wp_mail_from’ ); function default_wp_mail_from( $from_email ){ if( $from_email ==…
Copy this this on your choosed templates. Locate a file code : locate_template( array( 'function-custom.php' ), true ); Require a file code : require_once( 'functions-custom.php' ); Include a file code : include( 'functions-custom.php' ); Get template functions-woocommerce.php Ex: get_template_part( ‘partials/content’, ‘page’ ); get_template_part( 'functions-woocommerce' );
Get current posts parent category ID, permalink, name, etc via codes below. $ac_category = get_the_category( get_the_ID() ); // Use print_r($ac_category); to see all data. It includes name, slug, etc. echo esc_url( get_category_link( $ac_category[0]->term_id ) ); // this will show a category permalink
How to Zoom in effects in hover? Copy the HTML / CSS structure and paste it into your editor. Example: HTML <a class="zoom-in-hover" href="#"> <span class="group"> <img src="https://www.anthonypagaycarbon.com/wp-content/plugins/wordpress-popular-posts/no_thumb.jpg" alt="Zoom in effects in hover" /> </span> </a> CSS .zoom-in-hover { overflow: hidden; display: inline-block; text-align: center; } .zoom-in-hover .group { -webkit-transition: all 0.3s ease-in-out; -moz-transition: all…
Copy and paste the codes below to your custom template. global $current_user; echo get_avatar( $current_user->ID, 150, "https://www.anthonypagaycarbon.com/wp-content/uploads/2016/05/logo.png" ); For more detailed information, please visit here https://codex.wordpress.org/Function_Reference/get_avatar. Happy coding 🙂
How to get the parent product category ID, Name, etc in specific product? Just copy and paste the codes below. $object = get_queried_object(); $product_cat = get_the_terms( $object->ID, ‘product_cat’ ); echo $product_cat[0]->name; echo wpautop( $product_cat[0]->description );