Skip to content

Instantly share code, notes, and snippets.

<?php
// enqueue styles for child theme
// @ https://digwp.com/2016/01/include-styles-child-theme/
function example_enqueue_styles() {
//enqueue bootstrap.min.css
wp_enqueue_style( 'bootstrap-css', 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css' );
//enqueue bootstrap.min.js
//this makes a's width:50% and hwight:100%
.testimonial .et-pb-slider-arrows a {
position: absolute;
display: block;
height: 100%;
width: 50%;
top: 0;
z-index: 10;
@cannelflow
cannelflow / removedot.php
Created September 19, 2017 14:16
this code will remove dots after excerpts in divi theme
<?php
if ( ! function_exists( 'truncate_post' ) ) {
function truncate_post( $amount, $echo = true, $post = '', $strip_shortcodes = false ) {
global $shortname;
if ( '' == $post ) global $post;
$post_excerpt = '';
<?php
// Theme Support
function mywordstrap_theme_setup(){
//post-thumbnail
add_theme_support('post-thumbnails');
// Nav Menus
register_nav_menus(array(
<?php
//get data from advanced custome field
$project_title = get_field('project_title');
$project_body = get_field('project_body');
?>
<section id="project">
<article>
<?php
/*
Template Name: Home Page
*/
get_header(); ?>
<!--
===================================
Section Hero
===================================
It's fine, of course, to explicitly check for outdated modules,
and then run `npm install` to pull them in.
However, if you want to be a bit more lazy about it, there's a special
npm command that will UPDATE all of your deps to the max version you
allow in your package.json.
Can you guess what command that might be? (`npm help` might help you)
Update all your deps to the latest version possible, and then
type 1
//app.js code
var app1 = require("./Component/app1.js")
console.log(app1);
//app1.js code
var app = "Hello From app1.js"
module.exports = app;
type 2
//app.js code
var app1 = require("./Component/app1.js")
// Declare second integer, double, and String variables.
var j=12;
var d1 = 4.0;
var s1 = "is the best place to learn and practice coding!"
// Read and save an integer, double, and String to your variables.
var a = i+j;
var b = (d+d1).toFixed(1);
var c = s+s1;
// Print the sum of both integer variables on a new line.
@cannelflow
cannelflow / demo.js
Created March 26, 2016 14:16
demo.js
tried like
//update data
rects.attr({
"x": function (d) { return xScale(d.country); },
"y": function (d) { return yScale(d.gdp); },
"width": xScale.rangeBand(),
}).
attr("height", 0).
attr("y", h).
transition().duration(3000).