Skip to content

Instantly share code, notes, and snippets.

@hyperframed
Last active September 19, 2022 10:06
Show Gist options
  • Save hyperframed/e83bbaec981b65f48101f919bbd916cc to your computer and use it in GitHub Desktop.
Save hyperframed/e83bbaec981b65f48101f919bbd916cc to your computer and use it in GitHub Desktop.
VS Code Snippets for PHP
{
"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' ?>\">",
],
},
"Structural Comment": {
"prefix": "kk",
"body": [
"<!-- Begin $element -->",
],
},
"Structural Comment End": {
"prefix": "ke",
"body": [
"<!-- End $element -->",
],
},
"WP Theme Source Image Tag": {
"prefix": "sim",
"body": [
"<?php echo get_template_directory_uri() . '/inc/img/$image' ?>",
],
},
"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