Skip to content

Instantly share code, notes, and snippets.

@frensuren
frensuren / dabblet.css
Created October 14, 2014 11:19
Untitled
body{
font-size:50px;
}
.block{
width:600px;
margin:0 auto;
background:#ccc;
padding:30px;
text-align:center;
font-size:100%;
@frensuren
frensuren / JQuery-RelativeFixed-Plugin.markdown
Created November 27, 2014 10:01
JQuery RelativeFixed Plugin

JQuery RelativeFixed Plugin

Fixing an element relative to the parent which has overflow scroll.

A Pen by Surendra on CodePen.

License.

// SmoothScroll for websites v1.2.1
// Licensed under the terms of the MIT license.
// People involved
// - Balazs Galambosi (maintainer)
// - Michael Herf (Pulse Algorithm)
(function(){
// Scroll Variables (tweakable)
@frensuren
frensuren / wp_custom_permalink.php
Last active August 30, 2019 03:48
Code to register custom posttype and custom taxonomy with custom permalink structure.
@frensuren
frensuren / breadcrumb.php
Last active September 2, 2019 06:20
Generate Basic Wordpress Breadcrumb
<?php
/**
* Generate Breadcrumb
*/
function the_breadcrumb() {
if (!is_front_page()) {
// Start the breadcrumb with a link to your homepage
echo '<ol>';
echo '<li><a href="';
@frensuren
frensuren / custom_widget.php
Last active September 2, 2019 06:27
Register a Widget in Wordpress
<?php
class CustomWidget extends WP_Widget
{
public function __construct()
{
$widget_options = array(
'classname' => 'custom_widget',
'description' => 'This is a custom widget',
);
@frensuren
frensuren / customizer-custom-fileld.php
Last active September 2, 2019 06:31
Add setting in customizer
<?php
function wp_customize_register( $wp_customize ) {
if ( isset( $wp_customize->selective_refresh ) ) {
// Add Customizer Section
$wp_customize->add_section(
'contact_info',
// $argsv
array(
'title' => __('Contact Info', 'domain'),
'description' => __('Main Banner', 'domain')
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.triangle {
border-left: 50px solid red;
border-bottom: 50px solid transparent;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
.triangle {
border-left: 50px solid red;
border-bottom: 50px solid transparent;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
<style id="jsbin-css">
body {
padding: 100px;
}