Skip to content

Instantly share code, notes, and snippets.

@frensuren
frensuren / customizer-custom-fileld.php
Last active Sep 2, 2019
Add setting in customizer
View customizer-custom-fileld.php
<?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')
@frensuren
frensuren / custom_widget.php
Last active Sep 2, 2019
Register a Widget in Wordpress
View custom_widget.php
<?php
class CustomWidget extends WP_Widget
{
public function __construct()
{
$widget_options = array(
'classname' => 'custom_widget',
'description' => 'This is a custom widget',
);
@frensuren
frensuren / breadcrumb.php
Last active Sep 2, 2019
Generate Basic Wordpress Breadcrumb
View breadcrumb.php
<?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 / wp_custom_permalink.php
Last active Aug 30, 2019
Code to register custom posttype and custom taxonomy with custom permalink structure.
View wp_custom_permalink.php
View SmoothScroll.js
// 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)
View JQuery-RelativeFixed-Plugin.markdown

JQuery RelativeFixed Plugin

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

A Pen by Surendra on CodePen.

License.

View dabblet.css
body{
font-size:50px;
}
.block{
width:600px;
margin:0 auto;
background:#ccc;
padding:30px;
text-align:center;
font-size:100%;
You can’t perform that action at this time.