Skip to content

Instantly share code, notes, and snippets.

View carasmo's full-sized avatar

Christina carasmo

  • Florida
View GitHub Profile
<?php
//don't add the opening php
// goes inside functions.php file in a child GENESIS CHILD THEME ONLY
/*====== PAGE CHILDREN ===================================================================================================================================================
/* If the page has sub pages, those pages and the title of the parent page shows up as a menu in the sidebar (if there's a sidebar)
/* if the page is set to full width, then nope
/* @genesis_sidebar
/* ul child is .children
/* reference in part List topmost ancestor and its immediate children title on this page:
// GOES IN functions.php file
/**
# ---------------------------------------------------------------------------------------
# load latest font awesome from cdn
# @since 1.0
# ---------------------------------------------------------------------------------------
**/
function latest_font_awesome() {
wp_enqueue_style( 'font-awesome-latest', '//maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css' );
/* -- |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
add to functions.php in a Genesis child theme
||||||||||||||||||||||||||||||||||||||||||||||||||||||| -- */
/**
============================================================
/* CSS Document */
/* GWS - 12/2015 */
body {
background-color: #FFF
}
h2,
h3 {
@carasmo
carasmo / any-markup-in-genesis.php
Last active January 26, 2016 20:11
Use any markup in Genesis example. Starting with the Genesis Sample. This example code goes in your child theme's functions.php file. NOTICE: that the id on the nav is #foo-nav if you use skip links (and you should) you will need to filter the genesis_skip_links_output.
<?php
// don't include this
/** ====================================================================================
*
* Use any markup in Genesis example. Starting with the Genesis Sample.
* This example code goes in your child theme's
* functions.php file. NOTICE: that the id on the nav is #foo-nav
* if you use skip links (and you should) you will need to filter
* the genesis_skip_links_output.
@carasmo
carasmo / add-to-functions.php
Last active January 26, 2016 20:24
Genesis filter genesis_skip_links_output to add the registerd menu 'foo-menu' to the array. See other gist https://gist.github.com/carasmo/a988e9b4126cdb9f28e6
<?php
// don't include this
/** ====================================================================================
* add skip links to new nav
* filter 'genesis_skip_links_output' to add new
* https://gist.github.com/carasmo/a988e9b4126cdb9f28e6
@carasmo
carasmo / hide-something-at-breakpoint.css
Last active February 16, 2016 21:10
Hide something at a break point using max-width
@media (max-width:600px) {
.hide-sm {
display:none;
}
}
@carasmo
carasmo / smooth-scroll-to-anchor.js
Created February 22, 2016 18:58
Smooth scroll to anchor on load and click. Credit: http://stackoverflow.com/a/20320919/1004312
(function(document, $, undefined) {
'use strict';
$(document).ready(function() {
//* -------- smooth scroll to anchor links on click and load ----------------------------------------------------
@carasmo
carasmo / for-functions.php
Last active February 23, 2016 13:14
Paginate author page: goes in your child theme functions.php file (you can use other conditions, such as `if (!is_admin() && is_archive( 'name-of-cpt' ) )` for pagination on Custom Post Types.
<?php
//don't include this
function author_posts_per_page( $query ) {
if (!is_admin() && is_author() )
$query->set( 'posts_per_page', 5 );
}
@carasmo
carasmo / author.php
Last active February 23, 2016 14:19
author.php page in Genesis showing only the title with the title filtered to change the h2 into h3 -- see the other gist https://gist.github.com/carasmo/70a4fd9cc27d5822e03a to get pagination.
<?php
/**
* Template Name: Author Page
*/
remove_action( 'genesis_loop', 'genesis_do_loop' );
function child_do_custom_loop( ) {