Skip to content

Instantly share code, notes, and snippets.

@hyperframed
Last active September 19, 2022 10:08
Show Gist options
  • Save hyperframed/2a3708297c63dde8bdef75378ddb16ec to your computer and use it in GitHub Desktop.
Save hyperframed/2a3708297c63dde8bdef75378ddb16ec to your computer and use it in GitHub Desktop.
VS Code Snippets for HTML
{
"PHP Tag": {
"prefix": "pp",
"body": [
"<?php $code ?>",
],
},
"AOS Tag": {
"prefix": "aos",
"body": [
"data-aos=\"$animation\"",
],
},
"AOS DelayTag": {
"prefix": "aosd",
"body": [
"data-aos-delay=\"$delay\"",
],
},
"WP Theme Image Tag": {
"prefix": "tim",
"body": [
"<img class=\"$class\" alt=\"$alt\" width=\"$width\" loading=\"lazy\" src=\"<?php echo get_template_directory_uri() . '/inc/img/$image' ?>\">",
],
},
"WP Theme Source Image Tag": {
"prefix": "sim",
"body": [
"<?php echo get_template_directory_uri() . '/inc/img/$image' ?>",
],
},
"Structural Comment": {
"prefix": "kk",
"body": [
"<!-- Begin $element -->",
],
},
"Structural Comment End": {
"prefix": "ke",
"body": [
"<!-- End $element -->",
],
},
"WP Loop": {
"prefix": "loop",
"body": [
"<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>",
"",
"<?php endwhile; else : ?>",
"",
"<?php endif; ?>",
],
},
"ACF Get Field": {
"prefix": "tf",
"body": [
"the_field( '$field_name' );",
],
},
"ACF Get Field with PHP Tags": {
"prefix": "tfp",
"body": [
"<?php the_field( '$field_name' ); ?>",
],
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment