Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- // ### SNIPPET VERSION 5.9.4 ###
- // Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
- // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
- // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
- // used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
- // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
- // Placeholders with the same ids are connected.
- // Example:
- // "Print to console": {
- // "scope": "javascript,typescript",
- // "prefix": "log",
- // "body": [
- // "console.log('$1');",
- // "$2"
- // ],
- // "description": "Log output to console"
- // }
- // HTML Snipet
- "Html Box": {
- "prefix": "h-box",
- "body": [
- "<div class=\"box$1\">",
- " <h3> $2 Lorem </h3>",
- " <p> test </p>",
- "</div>"
- ],
- "description": "Box"
- },
- "Html Cover": {
- "prefix": "h-cover",
- "body": [
- "<div class=\"cover$1\" style=\"background-image:linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.6)), url('http://afmarchetti.github.io/alux/image.jpg');\">",
- " <h3> Lorem </h3>",
- " <p> test </p>",
- "</div>"
- ],
- "description": "Cover"
- },
- "Html Card": {
- "prefix": "h-card",
- "body": [
- "<div class=\"card$1\">",
- " <div class=\"card$1__img\" style=\"background-image: url('http://afmarchetti.github.io/alux/image.jpg');\"></div>",
- " <h3> Lorem </h3>",
- " <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis quidem provident totam, possimus reprehenderit repellat. Omnis, iusto officiis harum reprehenderit enim asperiores ex ducimus. Possimus quae, numquam at molestias aut?</p>",
- "</div>"
- ],
- "description": "Card"
- },
- "Html Title": {
- "prefix": "h-tit",
- "body": [
- " <h3 class=\"tit\">${1:lorem ispum dot siam}</h3>"
- ],
- "description": "Title"
- },
- "Subtitle": {
- "prefix": "h-sub",
- "body": [
- " <p class=\"sub\">${1:lorem ispum dot siam}</p>"
- ],
- "description": "Subtitle"
- },
- "Text": {
- "prefix": "h-text",
- "body": [
- " <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Perferendis quidem provident totam, possimus reprehenderit repellat. Omnis, iusto officiis harum reprehenderit enim asperiores ex ducimus. Possimus quae, numquam at molestias aut?</p>"
- ],
- "description": "Text"
- },
- "Html Button": {
- "prefix": "h-btn",
- "body": [
- " <a class=\"btn$1\" href=\"\">Lorem</a>"
- ],
- "description": "Button"
- },
- "Html Col 1": {
- "prefix": "h-1col",
- "body": [
- "<div class=\"grid\">",
- " <div class=\"col-100\">",
- " <h3> Lorem </h3>",
- " </div>",
- "</div>"
- ],
- "description": "Col 1"
- },
- "Html Col 2": {
- "prefix": "h-2col",
- "body": [
- "<div class=\"grid\">",
- " <div class=\"col-50\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-50\">",
- " <h3> Lorem </h3>",
- " </div>",
- "</div>"
- ],
- "description": "Col 2"
- },
- "Html Col 3": {
- "prefix": "h-3col",
- "body": [
- "<div class=\"grid\">",
- " <div class=\"col-33\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-33\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-33\">",
- " <h3> Lorem </h3>",
- " </div>",
- "</div>"
- ],
- "description": "Col 3"
- },
- "Html Col 4": {
- "prefix": "h-4col",
- "body": [
- "<div class=\"grid\">",
- " <div class=\"col-25\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-25\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-25\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-25\">",
- " <h3> Lorem </h3>",
- " </div>",
- "</div>"
- ],
- "description": "Col 4"
- },
- "Html Comment": {
- "prefix": "h-com",
- "body": [
- "<!-- $1 -->"
- ],
- "description": "Comment"
- },
- "Style": {
- "prefix": "h-style",
- "body": [
- "<link rel=\"stylesheet\" href=\"$1\">"
- ],
- "description": "Style"
- },
- "Jquery": {
- "prefix": "h-jquery",
- "body": [
- "<!-- Jquery -->",
- "<script src=\"https://ajax.googleapis.com/ajax/libs/jquery/3.1.0/jquery.min.js\"></script>"
- ],
- "description": "Jquery"
- },
- "Google Font": {
- "prefix": "h-googlefont",
- "body": [
- "<!-- Google Font -->",
- "<link rel=\"stylesheet\" href=\"//fonts.googleapis.com/css?family=Heebo:400,700\" type=\"text/css\" />"
- ],
- "description": "Google Font"
- },
- "Html Template": {
- "prefix": "h-template",
- "body": [
- "<!DOCTYPE html>",
- "<html lang=\"en\">",
- "<head>",
- " <meta charset=\"UTF-8\">",
- " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
- " <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
- " <title>Document</title>",
- " <link rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.1/normalize.min.css\">",
- " <link rel=\"stylesheet\" href=\"style.css\">",
- "",
- "</head>",
- "<body>",
- "",
- " <h1>Hey, Ciao Mondo! </h1>",
- "",
- " <script src=\"https://code.jquery.com/jquery-1.12.4.min.js\"></script>",
- "",
- "</body>",
- "</html>"
- ],
- "description": "Template"
- },
- "Html Template v2": {
- "prefix": "h-template-2",
- "body": [
- "<!DOCTYPE html>",
- "<html lang=\"en\">",
- "<head>",
- " <meta charset=\"UTF-8\">",
- " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
- " <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
- " <title>Document</title>",
- " <link href=\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\" rel=\"stylesheet\">",
- " <style>",
- " /* Reset */",
- " body, html{ font-family: 'Intro', sans-serif; font-size: 16px; box-sizing: border-box;margin: 0;padding: 0;}*,*:before,*:after{ box-sizing: border-box; }h1,h2,h3,h4,h5,h6, p, ol, ul{margin: 0 0 1rem 0;padding: 0;}ol,ul{list-style-type: none;}img{height: auto;}h1{font-size: 4rem;} h2{font-size: 3rem;} h3{font-size: 2rem;} h4{font-size: 1rem;} h5{font-size: 0.8rem;} h6{font-size: 0.6rem;}a{text-decoration:none}",
- " </style>",
- "",
- "</head>",
- "<body>",
- "",
- " <h1>Hey, Ciao Mondo! </h1>",
- "",
- " <script> /* js code */ </script>",
- "",
- "</body>",
- "</html>"
- ],
- "description": "Template v2"
- },
- // CSS Snipet
- "FlexBox": {
- "prefix": "c-fb-flexbox",
- "body": [
- "display:flex;justify-content:center;align-items: center;"
- ],
- "description": "FlexBox"
- },
- "Background Image": {
- "prefix": "c-bgimg",
- "body": [
- "background: url($1) no-repeat center center; background-size:cover;"
- ],
- "description": "Background Image"
- },
- "Background Gradient": {
- "prefix": "c-bg-gradient",
- "body": [
- "background: linear-gradient(0deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.2) 100%), url($1) no-repeat center center;"
- ],
- "description": "Background Gradient"
- },
- "Box": {
- "prefix": "c-box",
- "body": [
- ".box$1{ text-align: center; padding:10px; margin:10px; min-height:10px; display:flex; flex-direction:column; justify-content:center ;}"
- ],
- "description": "Box"
- },
- "Cover": {
- "prefix": "c-cover",
- "body": [
- ".cover$1{ text-align: center; padding:10px; margin:0px; min-height:600px; width:100%; display:flex; flex-direction:column; justify-content:center; background-position: center center; background-size:cover;}",
- ".cover$1 * {color:#fff}"
- ],
- "description": "Cover"
- },
- "Card": {
- "prefix": "c-card",
- "body": [
- ".card$1{padding:20px;box-shadow: 0 5px 20px rgba(0,0,0,.1);border-radius: 10px;overflow: hidden;margin: 0 15px 30px 15px; min-height: 450px}",
- ".card$1__img{min-height:200px;display: block;background-position: center center; background-size:cover;margin: -20px -20px 20px -20px;}",
- ""
- ],
- "description": "Card"
- },
- "Reset Css": {
- "prefix": "c-reset",
- "body": [
- "/* ! Reset */",
- "body, html{ font-size: 16px; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", \"Roboto\", \"Helvetica Neue\", Arial, sans-serif; box-sizing: border-box;margin: 0;padding: 0;}",
- "*,*:before,*:after{ box-sizing: border-box; }",
- "h1,h2,h3,h4,h5,h6, p, ol, ul{margin: 0;padding: 0;}",
- "ol,ul{list-style-type: none;}",
- "img{height: auto;}",
- ""
- ],
- "description": "Reset Css"
- },
- "Helpers": {
- "prefix": "c-helpers",
- "body": [
- "/* ! Helpers */",
- ".mt-0{margin-top: 0 }",
- ".mt-1{margin-top: 10px}",
- ".mt-2{margin-top: 20px}",
- ".mt-3{margin-top: 40px}",
- ".mt-4{margin-top: 100px }",
- "",
- ".mb-0{margin-bottom: 0}",
- ".mb-1{margin-bottom: 10px}",
- ".mb-2{margin-bottom: 20px}",
- ".mb-3{margin-bottom: 40px}",
- ".mb-4{margin-bottom: 100px}",
- "",
- ".p-0{padding: 0}",
- ".p-1{padding: 10px}",
- ".p-2{padding: 20px}",
- ".p-3{padding: 40px}",
- ".p-4{padding: 100px}",
- "",
- ".text-center { text-align: center; }",
- ".text-right { text-align: right; }",
- ".text-left { text-align: left; }",
- ".img-res { width: 100%; height: auto; margin-bottom: 20px;vertical-align: middle;}"
- ],
- "description": "Helpers"
- },
- "Title System": {
- "prefix": "c-titsystem",
- "body": [
- "/* ! Title System */",
- "h1 {font-size: 54px;margin-bottom: 20px}",
- "h2 {font-size: 34px;margin-bottom: 20px}",
- "h3 {font-size: 24px;margin-bottom: 20px}",
- "h4, p{font-size: 16px;margin-bottom: 20px}"
- ],
- "description": "Title System"
- },
- "Button System": {
- "prefix": "c-btnsystem",
- "body": [
- ".btn { font-style: 16px; text-transform: uppercase;background: #000; color:#fff; text-decoration: none;padding: 10px 15px; display: inline-block;margin:0 5px 20px 5px; border-radius: 4px;} "
- ],
- "description": "Button System"
- },
- "Button": {
- "prefix": "c-btn",
- "body": [
- ".btn$1{ padding: 10px 20px; font-size: 16px; background:#000; color:#fff;border-radius:4px; }"
- ],
- "description": "Button"
- },
- "Block Basic": {
- "prefix": "c-block",
- "body": [
- ".${1:block}{width: 100%; height: 300px; background: #333; display: flex; align-items: center; justify-content: center;}",
- ".${1:block}__content{color:#fff; text-align:center}"
- ],
- "description": "Block Basic"
- },
- "Border": {
- "prefix": "c-bd",
- "body": [
- "border: 1px solid red;"
- ],
- "description": "Border"
- },
- "Comment Big": {
- "prefix": "c-combig",
- "body": [
- "/* -------------------------------------------------------------------------------- */",
- "/* ! $1 */",
- "/* -------------------------------------------------------------------------------- */"
- ],
- "description": "Comment Big"
- },
- "Media Query": {
- "prefix": "c-mediaquery",
- "body": [
- "@media (max-width: 768px) {",
- " $1",
- "}"
- ],
- "description": "Media Query"
- },
- "WP Child Theme": {
- "prefix": "c-childtheme",
- "body": [
- "/*",
- "Theme Name: Theme Child",
- "Theme URL: http://yourdomain.com",
- "Description: Theme Child",
- "Theme Author: Mario Rossi",
- "Author URL: http://yourdomain.com",
- "Template: chaplin",
- "Version: 1.0.0",
- "Text Domain: theme-child",
- "",
- "*/"
- ],
- "description": "Child Theme"
- },
- "Animate All": {
- "prefix": "c-animate",
- "body": [
- ".animate { -webkit-transition: all 0.3s ease-in-out;",
- " -moz-transition: all 0.3s ease-in-out;",
- " -ms-transition: all 0.3s ease-in-out;",
- " -o-transition: all 0.3s ease-in-out;",
- " transition: all 0.3s ease-in-out; }"
- ],
- "description": "Animate All"
- },
- "Border Box": {
- "prefix": "c-borderbox",
- "body": [
- "*,",
- "*:before,",
- "*:after {",
- " -webkit-box-sizing: border-box;",
- " -moz-box-sizing: border-box;",
- " box-sizing: border-box;",
- "}"
- ],
- "description": "Border Box"
- },
- "Grid System": {
- "prefix": "c-gridsystem",
- "body": [
- "/* ! Grid System */",
- ".grid { margin: 0 auto; padding: 10px; max-width: 1200px; display: flex; flex-flow: row; flex-wrap: wrap;}",
- ".grid--center{justify-content: center;}",
- ".col{ flex: 1;}",
- ".v-center{justify-content:center;display: flex;min-height: 100%;align-items: center;}",
- "",
- "[class*='col-'] { position: relative;}",
- "",
- ".col-20{ width: 20%; }",
- ".col-25{ width: 25%; }",
- ".col-30{ width: 30%; }",
- ".col-33{ width: 33.33%; }",
- ".col-50{ width: 50%; }",
- ".col-70{ width: 70%; }",
- ".col-80{ width: 80%; }",
- ".col-100{ width: 100%; }",
- "",
- "@media (max-width: 991px) {",
- " .tab-20 { width: 20%; }",
- " .tab-25 { width: 25%; }",
- " .tab-33 { width: 33.33%; }",
- " .tab-50 { width: 50%; }",
- " .tab-100 { width: 100%; }",
- "}",
- "",
- "@media (max-width: 768px) {",
- " [class*='col-'] { width: 100%;}",
- " .sma-20 { width: 20%; }",
- " .sma-25 { width: 25%; }",
- " .sma-33 { width: 33.33%; }",
- " .sma-50 { width: 50%; }",
- " .sma-100 { width: 100%; }",
- "",
- " .sma-hide{display:none}",
- "}"
- ],
- "description": "Grid System"
- },
- "Font Family": {
- "prefix": "c-fontfamily",
- "body": [
- "font-family: \"Helvetica Neue\", Helvetica, Arial, sans-serif;"
- ],
- "description": "Font Family"
- },
- "Translate": {
- "prefix": "c-translate",
- "body": [
- "transform: translateY(20px);"
- ],
- "description": "Translate"
- },
- "Transition": {
- "prefix": "c-transition",
- "body": [
- "transition: all 1s cubic-bezier(.215, .61, .355, 1);"
- ],
- "description": "Transition"
- },
- "Box Shadow": {
- "prefix": "c-boxshadow",
- "body": [
- "box-shadow: 0 5px 20px rgba(0,0,0,.05);"
- ],
- "description": "Box Shadow"
- },
- "Vertical Center": {
- "prefix": "c-verticalcenter",
- "body": [
- "display: flex; width: 100%; height: 100%; align-items: center;"
- ],
- "description": "Vertical Center"
- },
- "Animation": {
- "prefix": "c-animation",
- "body": [
- "animation: my-animation 5s 3 ease-in-out;"
- ],
- "description": "Animation"
- },
- "Keyframe": {
- "prefix": "c-keyframe",
- "body": [
- "@keyframes my-animation{",
- "",
- " 0% {transform: rotate(0deg);}",
- " 20%{transform: rotate(0deg);}",
- " 40%{transform: rotate(10deg);}",
- " 60%{transform: rotate(-10deg);}",
- " 80%{transform: rotate(0deg);}",
- " 100% {transform: rotate(0deg);}",
- "",
- "}"
- ],
- "description": "Keyframe"
- },
- // Java Snipet
- "console.log": {
- "prefix": "j-log",
- "body": [
- "console.log(${1:\"crash\"});$2"
- ],
- "description": "console.log"
- },
- "Click Js": {
- "prefix": "j-click-toggle",
- "body": [
- "let ${1:item} = document.querySelector('.toggle-single');",
- "${1:item}.addEventListener(\"click\", function() {",
- " ${1:item}.classList.toggle('toggle-active');",
- "});"
- ],
- "description": "Click Js"
- },
- "Js Scroll to element": {
- "prefix": "j-scroll-to",
- "body": [
- "const links = document.querySelectorAll(\"ul.menu-scroll a\");",
- "",
- "links.forEach((link) => {",
- " link.addEventListener(\"click\", clickHandler);",
- "})",
- "",
- "function clickHandler(e) {",
- " e.preventDefault();",
- " const href = this.getAttribute(\"href\");",
- " const offsetTop = document.querySelector(href).offsetTop - 80; // offset from top",
- "",
- " scroll({",
- " top: offsetTop,",
- " behavior: \"smooth\"",
- " });",
- "}"
- ],
- "description": "Js Scroll to element"
- },
- "querySelectorAll": {
- "prefix": "j-selectall",
- "body": [
- "let items = document.querySelectorAll('${1:.selector}');"
- ],
- "description": "querySelectorAll"
- },
- "querySelector": {
- "prefix": "j-select",
- "body": [
- "let items = document.querySelector('${1:.selector}');"
- ],
- "description": "querySelector"
- },
- "forEach": {
- "prefix": "j-foreach",
- "body": [
- "${1:items}.forEach((item) => {",
- " item.addEventListener(\"click\", function() {",
- " item.classList.toggle('toggle-active');",
- " });",
- "});"
- ],
- "description": "forEach"
- },
- "for of": {
- "prefix": "j-forof",
- "body": [
- "for (let item of ${1:items}) {",
- " item.addEventListener(\"click\", function() {",
- " item.classList.toggle('toggle-active');",
- " });",
- "}"
- ],
- "description": "for of"
- },
- "Add class on Scroll": {
- "prefix": "j-addclasscroll",
- "body": [
- "window.addEventListener('scroll', function(e) {",
- " if(window.scrollY > 300){",
- " document.body.classList.add('scroll-down');",
- " } else {",
- " document.body.classList.remove('scroll-down');",
- " }",
- "});"
- ],
- "description": "Add class on Scroll"
- },
- "Observer": {
- "prefix": "j-observer",
- "body": [
- "// elements",
- "var elements_to_watch = document.querySelectorAll('.watch');",
- "// callback ",
- "var callback = function(items){",
- " items.forEach((item) => {",
- " if(item.isIntersecting){",
- " item.target.classList.add(\"in-page\");",
- " } else{",
- " item.target.classList.remove(\"in-page\");",
- " }",
- " });",
- "}",
- "// observer",
- "var observer = new IntersectionObserver(callback, { threshold: 0.5 } );",
- "// apply",
- "elements_to_watch.forEach((element) => {",
- " observer.observe(element); ",
- "});"
- ],
- "description": "Observe elements"
- },
- "Comment Js": {
- "prefix": "j-com",
- "body": [
- "/* -----------------------------------------------------------------------------------------------",
- " $1",
- "--------------------------------------------------------------------------------------------------- */"
- ],
- "description": "Comment Js"
- },
- //Jquery Snipepts
- "Toggle jQuery": {
- "prefix": "jq-toggle",
- "body": [
- "/* Open Panel */",
- "$( \".trigger\" ).on('click', function() {",
- " $(\".target\").toggleClass(\"open\");",
- "});"
- ],
- "description": "Toggle jQuery"
- },
- "Scroll Down jQuery": {
- "prefix": "jq-scroll",
- "body": [
- "/* Scroll Down */",
- "$('.scroll-down').click(function(event){",
- " event.preventDefault();",
- " //scroll down the panel",
- " $(\"html, body\").animate({ scrollTop: $('#anchor').offset().top }, 700);",
- "});"
- ],
- "description": "Scroll Down jQuery"
- },
- "Scroll Class jQuery": {
- "prefix": "jq-scrollclass",
- "body": [
- "/* Scroll Class */",
- "var scroll_pos = 0;",
- "$(document).scroll(function() {",
- " scroll_pos = $(this).scrollTop();",
- " if(scroll_pos > 40) {",
- " $(\"body\").addClass( \"scroll-down\" );",
- " } else {",
- " $(\"body\").removeClass( \"scroll-down\" );",
- " }",
- "});"
- ],
- "description": "Scroll Class jQuery"
- },
- "Scroll Nav jQuery": {
- "prefix": "jq-scrollnav",
- "body": [
- "// Scroll Navigation",
- "$(\"#menu a[href*='#']\").click( function() {",
- " var target = $(this).attr(\"href\");",
- " $(\"body, html\").animate({",
- " scrollTop: $(target).offset().top - 80",
- " }, 300);",
- " return false;",
- "});"
- ],
- "description": "Scroll Nav jQuery"
- },
- "Document Ready jQuery": {
- "prefix": "jq-doc",
- "body": [
- "$( document ).ready(function() {",
- " $1",
- "});"
- ],
- "description": "Document Ready jQuery"
- },
- "Click jQuery": {
- "prefix": "jq-click",
- "body": [
- "/* Click */",
- "$( \".trigger\" ).on('click', function() {",
- " // do something",
- "});"
- ],
- "description": "Click jQuery"
- },
- "Add Class jQuery": {
- "prefix": "jq-addclass",
- "body": [
- " $(\"body\").addClass( \"my-css-class\" );"
- ],
- "description": "Add Class jQuery"
- },
- "Remove Class jQuery": {
- "prefix": "jq-removeclass",
- "body": [
- " $(\"body\").removeClass( \"my-css-class\" );"
- ],
- "description": "Remove Class jQuery"
- },
- // PHP Snippet
- ".text.html.php": {
- "prefix": "p-tag",
- "body": [
- "<?php",
- " $1",
- "?>"
- ],
- "description": ".text.html.php"
- },
- "Include": {
- "prefix": "p-include",
- "body": [
- "<?php include(\"$1\");?>"
- ],
- "description": "Include"
- },
- "Var Dump": {
- "prefix": "var_dump()",
- "body": [
- "var_dump($1)"
- ],
- "description": "Var Dump"
- },
- "Prepare": {
- "prefix": "p-prepare",
- "body": [
- "$$query = $$mysqli->prepare(\"INSERT INTO posts(value1, value2) VALUES( ?, ?)\");",
- "$$query->bind_param('ss',$$value1, $$value2);",
- "if($$query->execute()){",
- " echo \"Data added successfully.\";",
- "} else {",
- " die(\"Data add failed: \" . htmlspecialchars($$query->error));",
- "}"
- ],
- "description": "Prepare"
- },
- // WP Snippets
- "Custom Loop": {
- "prefix": "wp-custom-loop",
- "body": [
- "<?php /* Custom Loop */",
- "",
- "$$custom_loop = new WP_Query( array(",
- " 'post_type' => 'page',",
- " 'posts_per_page' => 3,",
- " 'orderby' => 'menu_order',",
- " 'order' => 'ASC',",
- " ${1:// 'tax_query' => array(",
- " // array( 'taxonomy' => 'people',",
- " // 'field' => 'slug',",
- " // 'terms' => 'bob',",
- " // )",
- " // )}",
- ")); ?>",
- "",
- "<?php if ($$custom_loop->have_posts()) : while($$custom_loop->have_posts()) : $$custom_loop->the_post(); ?>",
- "",
- " <?php the_post_thumbnail('thumbnail', array('class' => '','alt' => get_the_title())); ?>",
- " <h3><?php the_title(); ?></h3>",
- " <?php the_content(); ?>",
- "",
- " <?php wp_reset_postdata(); ?>",
- " <?php endwhile; endif; ?>"
- ],
- "description": "Custom Loop"
- },
- "Img": {
- "prefix": "wp-imgbg",
- "body": [
- "<?php /* Image Url */",
- " $$image_attributes = wp_get_attachment_image_src( get_post_thumbnail_id( $$post->ID ), 'large' );",
- "?>",
- "<div class=\"$1\" style=\"background: url(<?php echo $$image_attributes[0]; ?>) center center; -webkit-background-size: cover; -moz-background-size: cover; background-size: cover; -o-background-size: cover;\">",
- " $2",
- "</div>"
- ],
- "description": "Img"
- },
- "Uri": {
- "prefix": "wp-uri",
- "body": [
- "<?php echo get_stylesheet_directory_uri(); ?>"
- ],
- "description": "Uri"
- },
- "Header": {
- "prefix": "wp-header",
- "body": [
- "<?php get_header(); ?>"
- ],
- "description": "Header"
- },
- "Is Search": {
- "prefix": "wp-is-search",
- "body": [
- "<?php if ( is_search() ) { ?>",
- "<?php esc_html_e('Result for:', 'slug-theme'); ?> <strong><i><?php echo $$s ?></i></strong>",
- "<?php } else if ( is_category() || is_tag() ) { ?>",
- "<?php echo single_cat_title() ?>",
- "<?php } else if ( is_home() ){ ?>",
- "<?php single_post_title(); ?>",
- "<?php } else if ( is_date() ){ ?>",
- "<?php single_month_title(' '); ?>",
- "<?php } else if ( is_archive() ){ ?>",
- "<?php post_type_archive_title(); ?>",
- "<?php } ?>"
- ],
- "description": "Is Search"
- },
- "Loop": {
- "prefix": "wp-loop",
- "body": [
- "<?php if (have_posts()) :?><?php while(have_posts()) : the_post(); ?>",
- "",
- " <!-- loop content -->",
- "",
- "<?php endwhile; ?>",
- " <p><?php previous_posts_link( 'Older posts' ); ?> - <?php next_posts_link( 'Newer posts' ); ?></p>",
- "<?php else : ?>",
- " <p><?php esc_html_e('Sorry, no posts matched your criteria.', 'slug-theme'); ?></p>",
- "<?php endif; ?>"
- ],
- "description": "Loop"
- },
- "Post Class": {
- "prefix": "wp-post-class",
- "body": [
- "<?php post_class(); ?>"
- ],
- "description": "Post Class"
- },
- "Permalink": {
- "prefix": "wp-permalink",
- "body": [
- "<?php the_permalink(); ?>"
- ],
- "description": "Permalink"
- },
- "Title": {
- "prefix": "wp-title",
- "body": [
- "<?php the_title(); ?>"
- ],
- "description": "Title"
- },
- "Time": {
- "prefix": "wp-time",
- "body": [
- "<?php the_time('j M , Y') ?>"
- ],
- "description": "Time"
- },
- "Category": {
- "prefix": "wp-category",
- "body": [
- "<?php the_category(', '); ?>"
- ],
- "description": "Category"
- },
- "Excerpt": {
- "prefix": "wp-excerpt",
- "body": [
- "<?php the_excerpt();?>"
- ],
- "description": "Excerpt"
- },
- "Sidebar": {
- "prefix": "wp-sidebar",
- "body": [
- "<?php get_sidebar(); ?>"
- ],
- "description": "Sidebar"
- },
- "Footer": {
- "prefix": "wp-footer",
- "body": [
- "<?php get_footer(); ?>"
- ],
- "description": "Footer"
- },
- "Language": {
- "prefix": "wp-lang",
- "body": [
- "<?php language_attributes();?>"
- ],
- "description": "Language"
- },
- "Description": {
- "prefix": "wp-desc",
- "body": [
- "<?php bloginfo( 'description' ); ?>"
- ],
- "description": "Description"
- },
- "Head": {
- "prefix": "wp-head",
- "body": [
- "<?php wp_head(); ?>"
- ],
- "description": "Head"
- },
- "Foot": {
- "prefix": "wp-foot",
- "body": [
- "<?php wp_footer(); ?>"
- ],
- "description": "Foot"
- },
- "Body": {
- "prefix": "wp-body",
- "body": [
- "<?php body_class(); ?>"
- ],
- "description": "Body"
- },
- "Home": {
- "prefix": "wp-home",
- "body": [
- "<?php echo home_url(); ?>"
- ],
- "description": "Home"
- },
- "Blog Title": {
- "prefix": "wp-blog-tit",
- "body": [
- "<?php bloginfo('title'); ?>"
- ],
- "description": "Blog Title"
- },
- "Menu": {
- "prefix": "wp-menu",
- "body": [
- "<?php",
- "wp_nav_menu(array(",
- " 'theme_location' => 'header',",
- " //'walker' => new Clean_Walker_Nav(),",
- " 'container' => false,",
- " 'items_wrap' => '<ul>%3$s</ul>'",
- "));",
- "?>"
- ],
- "description": "Menu"
- },
- "Name": {
- "prefix": "wp-name",
- "body": [
- "<?php bloginfo('name'); ?>"
- ],
- "description": "Name"
- },
- "Is Page Template": {
- "prefix": "wp-is-page-template",
- "body": [
- "<?php if (is_page_template( '$1' )) { ?>",
- "",
- " <!-- content to show -->",
- "",
- "<?php } ?>"
- ],
- "description": "Is Page Template"
- },
- "Copyright": {
- "prefix": "wp-copy",
- "body": [
- "<?php esc_html_e('© Copyright ', 'slug-theme'); ?> <?php echo date(\"o\");?>"
- ],
- "description": "Copyright"
- },
- "Theme Setup": {
- "prefix": "wp-theme-setup",
- "body": [
- "<?php",
- "/* Theme setup",
- "/* ------------------------------------ */",
- "if ( ! function_exists( 'slug-theme_setup' ) ) {",
- "",
- " function nakedpress_setup() {",
- "",
- " // Enable title in header",
- " add_theme_support( 'title-tag' );",
- "",
- " // Enable automatic feed links",
- " add_theme_support( 'automatic-feed-links' );",
- "",
- " // Enable featured image",
- " add_theme_support( 'post-thumbnails' );",
- "",
- " // Thumbnail sizes",
- " add_image_size( 'nakedpress_single', 800, 999, false );",
- " add_image_size( 'nakedpress_big', 1400, 928, true ); //(cropped)",
- "",
- " // Custom menu areas",
- " register_nav_menus( array(",
- " 'header' => esc_html__( 'Header', 'slug-theme' )",
- " ) );",
- "",
- " // Load theme languages",
- " load_theme_textdomain( 'slug-theme', get_template_directory().'/languages' );",
- "",
- " }",
- "",
- "}",
- "add_action( 'after_setup_theme', 'slug-theme_setup' );",
- "?>"
- ],
- "description": "Theme Setup"
- },
- "Sidebar Setup": {
- "prefix": "wp-sidebar-setup",
- "body": [
- "<?php",
- "/* Register sidebars",
- "/* ------------------------------------ */",
- "if ( ! function_exists( 'slug-theme_sidebars' ) ) {",
- "",
- " function nakedpress_sidebars() {",
- " register_sidebar(array( 'name' => esc_html__( 'Primary', 'slug-theme' ),'id' => 'primary','description' => esc_html__( 'Normal full width sidebar.', 'slug-theme' ), 'before_widget' => '<div id=\"%1$s\" class=\"widget %2$s\">','after_widget' => '</div>','before_title' => '<h3>','after_title' => '</h3>'));",
- " }",
- "",
- "}",
- "add_action( 'widgets_init', 'slug-theme_sidebars' );",
- "?>"
- ],
- "description": "Sidebar Setup"
- },
- "Script Setup": {
- "prefix": "wp-script-setup",
- "body": [
- "<?php",
- "/* Enqueue javascript",
- "/* ------------------------------------ */",
- "if ( ! function_exists( 'slug-theme_scripts' ) ) {",
- " function nakedpress_scripts() {",
- "",
- " wp_enqueue_script( 'slug-theme-script', get_template_directory_uri() . '/js/script.js', array( 'jquery' ),'', true );",
- " if ( is_singular() && get_option( 'thread_comments' ) ) { wp_enqueue_script( 'comment-reply' ); }",
- "",
- " }",
- "}",
- "add_action( 'wp_enqueue_scripts', 'slug-theme_scripts' );",
- "?>"
- ],
- "description": "Script Setup"
- },
- "Style Setup": {
- "prefix": "wp-style-setup",
- "body": [
- "<?php",
- "/* Enqueue css",
- "/* ------------------------------------ */",
- "if ( ! function_exists( 'slug-theme_styles' ) ) {",
- " function nakedpress_styles() {",
- "",
- " wp_enqueue_style( 'slug-theme-style', get_template_directory_uri().'/style.css');",
- "",
- " }",
- "}",
- "add_action( 'wp_enqueue_scripts', 'slug-theme_styles' );",
- "?>"
- ],
- "description": "Style Setup"
- },
- "Thumbnail": {
- "prefix": "wp-thumbnail",
- "body": [
- "<?php the_post_thumbnail('thumbnail', array('class' => 'img-res','alt' => get_the_title())); ?>"
- ],
- "description": "Thumbnail"
- },
- "Content": {
- "prefix": "wp-content",
- "body": [
- "<?php the_content(esc_html__('Read More...', 'slug-theme'));?>"
- ],
- "description": "Content"
- },
- "Page Link": {
- "prefix": "wp-pagelink",
- "body": [
- "<?php wp_link_pages('pagelink=Page %'); ?>"
- ],
- "description": "Page Link"
- },
- "Tag": {
- "prefix": "wp-tag",
- "body": [
- "<?php the_tags('', ', ', ''); ?>"
- ],
- "description": "Tag"
- },
- "Comments": {
- "prefix": "wp-comment",
- "body": [
- "<?php comments_template(); ?>"
- ],
- "description": "Comments"
- },
- "Dinamic Sidebar": {
- "prefix": "wp-dinamicsidebar",
- "body": [
- "<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('primary') ) : ?>",
- "<?php endif; ?>"
- ],
- "description": "Dinamic Sidebar"
- },
- "Text Translate": {
- "prefix": "wp-text-translate",
- "body": [
- "<?php esc_html_e( 'Results for: ', 'nextframe'); ?>"
- ],
- "description": "Text Translate"
- },
- "Search": {
- "prefix": "wp-search",
- "body": [
- "<?php get_search_form(); ?>"
- ],
- "description": "Search"
- },
- "Search Form": {
- "prefix": "wp-searchform",
- "body": [
- "<form class=\"search-form\" role=\"search\" method=\"get\" action=\"<?php echo home_url(); ?>\">",
- " <input type=\"text\" placeholder=\"<?php esc_html_e('Search', 'slug-theme'); ?>\" name=\"s\">",
- " <button type=\"submit\"><i class=\"fa fa-search\"></i></button>",
- "</form>"
- ],
- "description": "Search Form"
- },
- "Comments Template": {
- "prefix": "wp-commentstemplate",
- "body": [
- "<?php",
- "// ########## Do not delete these lines",
- "if (isset($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME'])){",
- " die (esc_html__('Please do not load this page directly. Thanks!', 'nakedpress' )); }",
- "if ( post_password_required() ) { ?>",
- " <p class=\"nocomments\"><?php esc_html_e('This post is password protected. Enter the password to view comments.', 'nakedpress'); ?></p>",
- "<?php",
- " return; }",
- "// ########## End do not delete section",
- "",
- "// Display Comments Section",
- "if ( have_comments() ) : ?>",
- " <h3 id=\"comments\"><?php comments_number( esc_html__( 'No Responses', 'nakedpress' ), esc_html__( '1 Response', 'nakedpress' ), esc_html__( '% Responses', 'nakedpress') ); ?></h3>",
- " <div class=\"navigation\">",
- " <div class=\"alignleft\"><?php previous_comments_link() ?></div>",
- " <div class=\"alignright\"><?php next_comments_link() ?></div>",
- " </div>",
- " <ol class=\"commentlist\">",
- " <?php",
- " wp_list_comments(array(",
- " 'avatar_size' => 64,",
- " ));",
- " ?>",
- " </ol>",
- " <div class=\"navigation\">",
- " <div class=\"alignleft\"><?php previous_comments_link() ?></div>",
- " <div class=\"alignright\"><?php next_comments_link() ?></div>",
- " </div>",
- " <?php",
- " if ( ! comments_open() ) : // There are comments but comments are now closed ?>",
- " <p class=\"nocomments\"><?php esc_html_e('Comments are closed.', 'nakedpress'); ?></p>",
- " <?php",
- " endif;",
- "",
- "else : // I.E. There are no Comments",
- " if ( comments_open() ) : // Comments are open, but there are none yet",
- " // echo\"<p>Be the first to write a comment.</p>\";",
- " else : // comments are closed ?>",
- " <p class=\"nocomments\"><?php esc_html_e('Comments are closed.', 'nakedpress'); ?></p>",
- " <?php",
- " endif;",
- "endif;",
- "",
- "// Display Form/Login info Section",
- "// the comment_form() function handles this and can be used without any paramaters simply as \"comment_form()\"",
- "comment_form(array(",
- " // see codex http://codex.wordpress.org/Function_Reference/comment_form for default values",
- " // tutorial here http://blogaliving.com/wordpress-adding-comment_form-theme/",
- " 'comment_field' => '<p><textarea name=\"comment\" id=\"comment\" cols=\"58\" rows=\"10\" tabindex=\"4\" aria-required=\"true\"></textarea></p>',",
- " 'label_submit' => ''.esc_html__('Submit Comment','nakedpress').'',",
- " 'comment_notes_after' => ''",
- " ));",
- "",
- "// RSS comments link",
- "echo '<div class=\"comments_rss\">';",
- "post_comments_feed_link(''.esc_html__('Comments RSS Feed', 'nakedpress').'');",
- "echo '</div>';",
- "",
- "?>"
- ],
- "description": "Comments Template"
- },
- "404": {
- "prefix": "wp-404",
- "body": [
- "<h1><?php esc_html_e( 'Oops! That page can’t be found.', 'slug-theme' ); ?></h1>",
- "<h2><?php esc_html_e( '404 Error', 'slug-theme' ); ?></h2>",
- "<p><?php esc_html_e( 'The page you are trying to reach does not exist, or has been moved. Please use the menus or the search box to find what you are looking for.', 'slug-theme' ); ?></p> "
- ],
- "description": "404"
- },
- "Walker": {
- "prefix": "wp-walker",
- "body": [
- "<?php",
- "class Clean_Walker_Nav extends Walker_Nav_Menu {",
- " /**",
- " * Filter used to remove built in WordPress-generated classes",
- " * @param mixed $var The array item to verify",
- " * @return boolean Whether or not the item matches the filter",
- " */",
- " function filter_builtin_classes( $$var ) {",
- " return ( FALSE === strpos( $$var, 'item' ) ) ? $$var : '';",
- " }",
- "",
- " function start_lvl( &$$output, $$depth = 0, $$args = array() ) {",
- " $$indent = str_repeat(\"\\t\", $$depth);",
- " $$output .= \"\\n$indent<ul class=\\\"dropdown-menu\\\">\\n\";",
- " }",
- "",
- " function start_el( &$$output, $$item, $$depth = 0, $$args = array(), $$id = 0 ) {",
- " $$indent = ( $$depth ) ? str_repeat( \"\\t\", $$depth ) : '';",
- "",
- " $$class_names = $$value = '';",
- "",
- " $$unfiltered_classes = empty( $$item->classes ) ? array() : (array) $$item->classes;",
- " $$classes = array_filter( $$unfiltered_classes, array( $$this, 'filter_builtin_classes' ) );",
- "",
- " /* add custom classes if is active */",
- " if ( preg_grep(\"/^current-menu-item/\", $$unfiltered_classes) ) {",
- " $$classes[] = 'active';",
- " }",
- "",
- " /* add custom classes if is parent */",
- " if ( preg_grep(\"/^menu-item-has-children/\", $$unfiltered_classes ) ) {",
- " $$classes[] = 'dropdown';",
- " }",
- "",
- " $$class_names = join( ' ', apply_filters( 'nav_menu_css_class', array_filter( $$classes ), $$item, $$args ) );",
- " $$class_names = $$class_names ? ' class=\"' . esc_attr( $$class_names ) . '\"' : '';",
- "",
- " $$id = apply_filters( 'nav_menu_item_id', 'menu-item-'. $$item->ID, $$item, $$args );",
- " $$id = $$id ? ' id=\"' . esc_attr( $$id ) . '\"' : '';",
- "",
- "",
- " $$output .= $$indent . '<li' . $$value . $$class_names .'>';",
- "",
- "",
- " $$atts = array();",
- " $$atts['title'] = ! empty( $$item->attr_title ) ? $$item->attr_title : '';",
- " $$atts['target'] = ! empty( $$item->target ) ? $$item->target : '';",
- " $$atts['rel'] = ! empty( $$item->xfn ) ? $$item->xfn : '';",
- " $$atts['href'] = ! empty( $$item->url ) ? $$item->url : '';",
- "",
- " $$atts = apply_filters( 'nav_menu_link_attributes', $$atts, $$item, $$args );",
- "",
- " $$attributes = '';",
- " foreach ( $$atts as $$attr => $$value ) {",
- " if ( ! empty( $$value ) ) {",
- " $$value = ( 'href' === $$attr ) ? esc_url( $$value ) : esc_attr( $$value );",
- " $$attributes .= ' ' . $$attr . '=\"' . $$value . '\"';",
- " }",
- " }",
- "",
- " $$item_output = $$args->before;",
- "",
- " /* dropdown */",
- " if ( preg_grep(\"/^menu-item-has-children/\", $$unfiltered_classes ) ) {",
- " $$item_output .= '<a'. $$attributes .' data-toggle=\"dropdown\">';",
- " } else {",
- " $$item_output .= '<a'. $$attributes .'>';",
- " }",
- "",
- " $$item_output .= $$args->link_before . apply_filters( 'the_title', $$item->title, $$item->ID ) . $$args->link_after;",
- "",
- " /* dropdown */",
- " if ( preg_grep(\"/^menu-item-has-children/\", $$unfiltered_classes ) ) {",
- " $$item_output .= '<div class=\"arrow animate\"></div></a>';",
- " } else {",
- " $$item_output .= '</a>';",
- " }",
- "",
- " $$item_output .= $$args->after;",
- "",
- " $$output .= apply_filters( 'walker_nav_menu_start_el', $$item_output, $$item, $$depth, $$args );",
- " }",
- "",
- "} // Walker_Nav_Menu",
- "?>"
- ],
- "description": "Walker"
- },
- "Include in functions.php": {
- "prefix": "wp-incfunctions",
- "body": [
- "require_once('inc/nakedpress_navwalker.php');"
- ],
- "description": "Include in functions.php"
- },
- "Include Parts": {
- "prefix": "wp-inc",
- "body": [
- "<?php get_template_part('inc/example-cover'); ?>"
- ],
- "description": "Include Parts"
- },
- "Child Theme": {
- "prefix": "wp-childtheme",
- "body": [
- "<?php /* Child Theme */",
- "add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX);",
- "function enqueue_child_theme_styles() {",
- "",
- " wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );",
- " wp_enqueue_style( 'child-style',",
- " get_stylesheet_directory_uri() . '/style.css',",
- " array('parent-style'),",
- " wp_get_theme()->get('Version')",
- " );",
- "",
- "} ?>"
- ],
- "description": "Child Theme"
- },
- "Template": {
- "prefix": "wp-template",
- "body": [
- "<?php",
- " /*",
- " *",
- " * Template Name: Template Name",
- " *",
- " */",
- "?>"
- ],
- "description": "Template"
- },
- "Custom Shortcode": {
- "prefix": "wp-shortcode-custom",
- "body": [
- "function custom_shortcode() {",
- "",
- " $$buffer = '<div class=\"shortcode-custom\">';",
- " $$buffer .= '<p>Ciao!</p>';",
- " $$buffer .= '</div>';",
- "",
- " return $$buffer;",
- "}",
- "add_shortcode('nameshortcode', 'custom_shortcode');"
- ],
- "description": "Custom Shortcode"
- },
- "Custom Color Palette Gutenberg": {
- "prefix": "wp-custom-color-gutenberg",
- "body": [
- "function nakedbase_custom_gutenberg_color_palette() {",
- " add_theme_support(",
- " 'editor-color-palette',",
- " [",
- " [",
- " 'name' => esc_html__( 'Brown', 'nakedbase' ),",
- " 'slug' => 'brown',",
- " 'color' => '#3a3335',",
- " ],",
- " [",
- " 'name' => esc_html__( 'Orange', 'nakedbase' ),",
- " 'slug' => 'orange',",
- " 'color' => '#f0544f',",
- " ],",
- " [",
- " 'name' => esc_html__( 'Light Gray', 'nakedbase' ),",
- " 'slug' => 'light-gray',",
- " 'color' => '#eee',",
- " ],",
- " [",
- " 'name' => esc_html__( 'White', 'nakedbase' ),",
- " 'slug' => 'white',",
- " 'color' => '#fff',",
- " ],",
- "",
- " ]",
- " );",
- "}",
- "add_action( 'after_setup_theme', 'nakedbase_custom_gutenberg_color_palette' );"
- ],
- "description": "Custom Color Palette Gutenberg"
- },
- "Logged In": {
- "prefix": "wp-logged-in",
- "body": [
- "<?php if ( is_user_logged_in() ) { ?> <?php } ?>"
- ],
- "description": "Logged In"
- },
- "Comment Php": {
- "prefix": "p-comment",
- "body": [
- "/*",
- " * @functions ",
- " * @description ",
- " *",
- " */"
- ],
- "description": "Comment with description in php"
- },
- // HTML Snipet variant
- "Comment": {
- "prefix": "h-com",
- "body": [
- "<!-- $1 -->"
- ],
- "description": "Comment"
- },
- "Col 1": {
- "prefix": "h-1col",
- "body": [
- "<div class=\"grid\">",
- " <div class=\"col-100\">",
- " <h3> Lorem </h3>",
- " </div>",
- "</div>"
- ],
- "description": "Col 1"
- },
- "Col 2": {
- "prefix": "h-2col",
- "body": [
- "<div class=\"grid\">",
- " <div class=\"col-50\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-50\">",
- " <h3> Lorem </h3>",
- " </div>",
- "</div>"
- ],
- "description": "Col 2"
- },
- "Col 3": {
- "prefix": "h-3col",
- "body": [
- "<div class=\"grid\">",
- " <div class=\"col-33\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-33\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-33\">",
- " <h3> Lorem </h3>",
- " </div>",
- "</div>"
- ],
- "description": "Col 3"
- },
- "Col 4": {
- "prefix": "h-4col",
- "body": [
- "<div class=\"grid\">",
- " <div class=\"col-25\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-25\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-25\">",
- " <h3> Lorem </h3>",
- " </div>",
- " <div class=\"col-25\">",
- " <h3> Lorem </h3>",
- " </div>",
- "</div>"
- ],
- "description": "Col 4"
- },
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement