Skip to content

Instantly share code, notes, and snippets.

View martinkariuki7's full-sized avatar
👨‍💻
Design + Code

Martin Kariuki martinkariuki7

👨‍💻
Design + Code
View GitHub Profile
@martinkariuki7
martinkariuki7 / dynamicform.html
Created April 18, 2016 12:02
Dynamically add form fields with jquery
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#btnAdd').click(function() {
@martinkariuki7
martinkariuki7 / function.php
Created April 18, 2016 09:16 — forked from mkdizajn/function.php
Wordpress Bootstrap 3 responsive images
<?php
//----------------------------------------------------------/
// responsive images [ 1) add img-responsive class 2) remove dimensions ]
//----------------------------------------------------------/
function bootstrap_responsive_images( $html ){
$classes = 'img-responsive'; // separated by spaces, e.g. 'img image-link'
// check if there are already classes assigned to the anchor
if ( preg_match('/<img.*? class="/', $html) ) {