Skip to content

Instantly share code, notes, and snippets.

@eyecandy91
eyecandy91 / gist:ec5e29bbf933bbe100ccc75bda02017a
Created June 19, 2019 07:11
copy input value to other input
$('#quantity input').change(function() {
$('#product-quantity').val($(this).val());
});
@eyecandy91
eyecandy91 / gist:64f3e89f3e3e7e23e9b45aae6c353634
Created June 19, 2019 07:05
Copy html from div into input
$('button').click(function() {
var divContents = $('#price').html();
console.log(divContents);
$('#product-price').val( $('#price').html() );
$('#product-name').val( $('#name').html() );
$('#product-size').val( $('#size #value').html() );
});
<?php
while (have_posts()) :
the_post();
the_content();
endwhile; // End of the loop.
?>
@eyecandy91
eyecandy91 / gist:6da77ef2c4e04ac86a3ec8e43d8bf5f2
Created June 17, 2019 12:52
Get name of title of page inside loop and query
$name = get_the_title();
if ($name == "Flow iron and hose") { ?>
} ?>
@eyecandy91
eyecandy91 / gist:452beeae8f6c3e704de6c13b0ad0514d
Created April 25, 2019 03:54 — forked from govindak/gist:7435288
Get the featured image by page ID in WordPress
<?php
//page id
$page_id = "5"; //example
if (has_post_thumbnail($page_id) ):
$image = wp_get_attachment_image_src( get_post_thumbnail_id($page_id), 'single-post-thumbnail' );
endif;
$image_URI = $image[0];
@eyecandy91
eyecandy91 / toggle-menu.js
Created April 24, 2019 12:38 — forked from Bradcomp/toggle-menu.js
Toggles the .is-active class for a hamburger menu
(function() {
var burger = document.querySelector('.nav-toggle');
var menu = document.querySelector('.nav-menu');
burger.addEventListener('click', function() {
burger.classList.toggle('is-active');
menu.classList.toggle('is-active');
});
})();
OR
<?php
$args = array(
'post_type'= 'project'
//multiple category needed
'category_name' => 'upcoming,residential'
'post_per_page' => 10
);
AND
…or create a new repository on the command line
echo "# golf" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:eyecandy91/golf.git
git push -u origin master
…or push an existing repository from the command line
git remote add origin git@github.com:eyecandy91/golf.git
node_modules
.github/*
bulma
js-dev
.vscode/*