Free
Add extra fee to COD payment gateway
Prettier doesn’t format the code
- Go to Settings and search for formatter.
- Set the default formatter to Prettier
Use SVG Icons
.icon { display: inline-block; min-width: 5px; min-height: 5px; background-position: center; background-size: contain; background-repeat: no-repeat; } .icon.icon-print { background-image: url('../images/icons/print.svg'); min-width: 20px; min-height: 20px; }
<i class="icon icon-print"></i>
Insert page in to another page
// ========================================================================= // INSERT PAGE TO ANOTHER PAGE // ========================================================================= function page_partners() { $args = new WP_Query("page_id=285"); while($args->have_posts()) : $args->the_post(); the_content(); endwhile; }
Tab Panel with JavaScript
ACF Option Pages with Repeater Group and File
SCSS
Hamburger menu for WordPress custom theme
Enqueue Scripts Asynchronously in WordPress
If you regularly build sites with WordPress and test them against Google PageSpeed Insights, you’ll probably have encountered it complaining about async and defer on your scripts.
v@wordpress/scripts
The official WordPress JavaScript tool
npm install @wordpress/scripts --save-dev
package.json
npm install
Changing file entry and output of build scripts
Watch and compile
npm run start
Import JavaScript
Automatically set image Alt-Text during upload in WordPress
File Renaming on Upload without plugin in WordPress
Rename files during upload within WordPress
How to remove accents from uploaded filenames
Remove Genesis Admin Warnings
If You have a Genesis Pro Lifetime subscription, there’s an annoying notification in the plugins section. Just paste the following snippet in the functions.php to remove the warning messages.
Display Option Pages for Post Object, Repeater
<?php if( have_rows('your_repeater_field', 'option') ): ?> <?php while ( have_rows('your_repeater_field', 'option') ) : the_row(); ?> <?php $post_object = get_sub_field('your_post_object', 'option'); ?> <?php if( $post_object ): ?> <?php $post = $post_object; setup_postdata( $post ); $title = get_the_title( $post_object->ID); ?> <h4><?= $title ?></h4> <?php wp_reset_postdata(); ?> <?php endif; ?> <?php endwhile; ?> <?php endif; ?>
ACF Query Upcoming and Past Events
events-query.php
upcoming.php
past.php