Skip to content

Instantly share code, notes, and snippets.

@joemeador
joemeador / twenty thirteen functions.php widget_init
Last active December 30, 2015 23:19
Code used in default wordpress twenty thirteen theme to register main and secondary widget areas.
<?php
//* Do NOT include the opening php tag
function twentythirteen_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Widget Area', 'twentythirteen' ),
'id' => 'sidebar-1',
'description' => __( 'Appears in the footer section of the site.', 'twentythirteen' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
<?php
//* Do NOT include the opening php tag
function twentythirteen_widgets_init() {
register_sidebar( array(
'name' => __( 'Main Widget Area', 'twentythirteen' ),
'id' => 'sidebar-1',
'description' => __( 'Appears in the footer section of the site.', 'twentythirteen' ),
'before_widget' => '<aside id="%1$s" class="widget %2$s">',
'after_widget' => '</aside>',
<?php
//* Do NOT include the opening php tag
if ( is_active_sidebar( 'sidebar-custom' ) ) : ?>
<div id="customized" class="custom-sidebar">
<div class="header-menu">
<div class="widget-area">
<?php dynamic_sidebar( 'sidebar-custom' ); ?>
</div>
</div>
<?php
/**
* The Header template for our theme
*
* Displays all of the <head> section and everything up till <div id="main">
*
* @package WordPress
* @subpackage Twenty_Thirteen
* @since Twenty Thirteen 1.0
*/
<header id="masthead" class="site-header" role="banner">
<div id="customized" class="custom-sidebar">
<div class="header-menu">
<div class="widget-area">
<div id="text-3" class="widget widget_text">
<div class="textwidget">This is the custom widget area. </div>
</div>
</div>
</div>
</div>
@joemeador
joemeador / Adding jQuery to page.xml
Last active August 29, 2015 13:56
Add jQuery to Magento page.xml
<action method="addItem"><type>skin_js</type><name>jquery/jquery-1.11.0.noconflict.min.js</name></action>
@joemeador
joemeador / page.xml snapshot
Last active August 29, 2015 13:56
All Magento .js files in page.xml
<default translate="label" module="page">
<label>All Pages</label>
<block type="page/html" name="root" output="toHtml" template="page/3columns.phtml">
<block type="page/html_head" name="head" as="head">
<action method="addJs"><script>prototype/prototype.js</script></action>
<action method="addJs"><script>lib/ccard.js</script></action>
<action method="addJs"><script>prototype/validation.js</script></action>
<action method="addJs"><script>scriptaculous/builder.js</script></action>
<action method="addJs"><script>scriptaculous/effects.js</script></action>
@joemeador
joemeador / main.js
Last active August 29, 2015 13:56
The top line puts jQuery in noConflict mode. Lines 3-5 simply show an example of jQuery in use.
var jQuery = jQuery.noConflict();
jQuery(document).ready(function(){
jQuery("#nav").css("padding","15px");
});
<?php
/*
Template Name: Sitemap Page
*/
genesis();
<?php
/*
Template Name: Sitemap Page
*/
//Add pages to sitemap
add_action( 'genesis_entry_content', 'page_sitemap_pages' );
function page_sitemap_pages() {
echo "<div class='half'>";