Skip to content

Instantly share code, notes, and snippets.

View phpbits's full-sized avatar
🎯
Focusing

Jeffrey Carandang phpbits

🎯
Focusing
View GitHub Profile
@phpbits
phpbits / functions.php
Last active October 4, 2016 08:07
Create Genesis Framework Widgetized Homepage
<?php
/* CUSTOM SIDEBAR
========================================================================== */
add_action('init', 'hp_register_sidebar_widgets');
function hp_register_sidebar_widgets(){
register_sidebar(array(
'name' => __( 'Homepage Widgets', 'widget-options' ),
'id' => 'homepage-widgets',
'description' => __( 'Widgets in this area will be shown on homepage after header section.', 'widget-options' ),
@phpbits
phpbits / style.css
Created October 4, 2016 08:17
Genesis Custom Homepage Widgets Styling
/* # Homepage Widgets
---------------------------------------------------------------------------------------------------- */
.hp-widgets-section{
padding: 50px 0px 30px;
border-bottom: 1px solid #eee;
}
.hp-widgets-section .widget{
padding: 30px 20px 0px;
}
@phpbits
phpbits / umd-script-boilerplate.js
Created April 6, 2017 11:02 — forked from cferdinandi/umd-script-boilerplate.js
A simple boilerplate for UMD JS modules.
(function (root, factory) {
if ( typeof define === 'function' && define.amd ) {
define([], factory(root));
} else if ( typeof exports === 'object' ) {
module.exports = factory(root);
} else {
root.myPlugin = factory(root);
}
})(typeof global !== "undefined" ? global : this.window || this.global, function (root) {
@phpbits
phpbits / functions.php
Created September 12, 2017 08:57
Enable WordPress Genesis Footer Widget Area
<?php
//* Add support for one fullwidth footer widgets
add_theme_support( 'genesis-footer-widgets', 1 );
?>
@phpbits
phpbits / style.css
Created September 12, 2017 08:58
Full Width Genesis Footer w/ Styling
/* # Full Width Genesis Footer w/ Styling
------------------------------------------- */
.footer-widgets{
background-color: #232525;
}
.footer-widgets, .footer-widgets a, .footer-widgets .widgettitle{
color: #fff;
text-decoration: none;
}
.footer-widgets-1.footer-widget-area{
@phpbits
phpbits / style.css
Created September 12, 2017 08:59
Genesis Instagram Widget Custom Style
/* Instagram
---------------------------------------------------------------------------------------------------- */
.instagram {
overflow: hidden;
}
.instagram .wrap {
border-top: 1px solid #eee;
margin-left: auto;
@phpbits
phpbits / style.css
Created September 12, 2017 09:00
Digital Pro Custom Footer Background Gradient
.footer-widgets{
padding: 0px;
background: linear-gradient(90deg, #dd3333 50%, #000000 50%);
}
.footer-widgets .widget{
padding: 90px 40px;
margin: 0px;
}
.footer-widgets .widget-title{
text-transform: uppercase;
@phpbits
phpbits / style.css
Created September 12, 2017 09:01
Genesis Workstation Pro Widget Styling
.site-footer{
background-color: #232525;
text-align: left;
}
.site-footer, .site-footer a{
color: #fff;
text-decoration: none;
border: 0px;
}
.site-footer-hi .widget-title{
@phpbits
phpbits / custom-sidebar.php
Created August 30, 2018 08:56
Create Custom Sidebar
<?php
/*
* Create Custom Widget Area for Pages Only
*/
function page_only_custom_sidebar() {
register_sidebar(
array (
'name' => __( 'For Pages Only', 'your-site' ),
'id' => 'page-only-custom-sidebar',
'description' => __( 'Contents to this widget area will be displayed on pages only.', 'your-site' ),
@phpbits
phpbits / sidebar.php
Created August 30, 2018 08:57
Display Custom Sidebar on Pages only
<?php if ( is_active_sidebar( 'page-only-custom-sidebar' ) && is_page() ) : ?>
<aside id="secondary" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'page-only-custom-sidebar' ); ?>
</aside>
<?php endif; ?>