Skip to content

Instantly share code, notes, and snippets.

View nickdavis's full-sized avatar

Nick Davis nickdavis

View GitHub Profile
@nickdavis
nickdavis / contact-page.html
Created May 31, 2016 12:24
Contact Page (Kickstart Pro) - Lower text and form, two column layout
<div class="one-half first">
<h1>Contact Page</h1>
* This contact form was developed with a third party plugin called <a href="http://www.studiopress.com/go/gravity">Gravity Forms</a> and is not included in the Genesis Framework. It is for display on this demo site - though we highly recommend using it.
</div>
<div class="one-half">[gravityform id=1 name=ContactForm title=false description=false]</div>
@nickdavis
nickdavis / style.css
Created July 6, 2016 16:20
Updated Kickstart Pro styles for Gravity Forms 2.0 (added in Kickstart Pro v1.3.5)
/* Gravity Forms
--------------------------------------------- */
div.gform_wrapper input[type="email"],
div.gform_wrapper input[type="tel"],
div.gform_wrapper input[type="text"],
div.gform_wrapper input:not([type=radio]):not([type=checkbox]):not([type=submit]):not([type=button]):not([type=image]):not([type=file]),
div.gform_wrapper textarea,
div.gform_wrapper .ginput_complex label {
font-size: 16px;
@nickdavis
nickdavis / style.css
Created July 18, 2016 13:38
Edit logo file location in Kickstart Pro theme (replace the following two sections in your theme's style.css file or use a custom CSS plugin: https://themevalet.com/making-wordpress-css-adjustments-without-editing-theme/)
/* Logo, hide text */
.header-image .site-header .wrap {
background: url(http://yourwebsite.com/wp-content/uploads/2016/07/logo-1.png) no-repeat left center;
padding: 0;
}
@media only screen and (max-width: 900px) {
.header-image .site-header .wrap {
@nickdavis
nickdavis / style.css
Created July 27, 2016 18:30
Hide the Kickstart Pro homepage background image below a certain width and set a background colour instead
@media only screen and (max-width: 480px) {
/* Hide the regular background image */
.home .before-content .backstretch {
display: none !important;
}
/* Set a colour so we don't end up with white on white text */
.home .before-content {
background-color: #8dc1d9;
@nickdavis
nickdavis / 0_reuse_code.js
Created August 16, 2016 07:52
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@nickdavis
nickdavis / single.php
Last active August 16, 2016 08:09
Check the width of a post's featured image in WordPress and use it to determine which image size should be displayed
<?php
function nd_featured_image_size_sniff() {
if ( ! has_post_thumbnail() ) {
return;
}
$featured_image_id = get_post_thumbnail_id( get_the_ID() );
$featured_image_metadata = wp_get_attachment_metadata( $featured_image_id );
@nickdavis
nickdavis / functions.php
Last active August 17, 2016 13:49
Search for genesis-footer-widgets in your theme's functions.php file and change the number you find to the number of widget areas you would like (you may also need to tweak the CSS found in the theme's style.css file to achieve your desired layout)
<?php
add_theme_support( 'genesis-footer-widgets', 3 );
@nickdavis
nickdavis / functions.php
Last active September 1, 2016 11:15
Don't do backstretch on the Kickstart Pro homepage (not tested, assumes you're coding a custom solution instead)
<?php
add_action( 'wp_enqueue_scripts', 'kickstart_enqueue_backstretch_scripts' );
// Enqueue Backstretch script and prepare images for loading
function kickstart_enqueue_backstretch_scripts() {
// Don't do any backstretching on the homepage (CUSTOM)
if ( is_front_page() ) {
return;
}
@nickdavis
nickdavis / style.css
Last active September 5, 2016 14:24
Extract of style.css, showing an untested example of how you might adjust the mobile logo size (and space around it) on Kickstart Pro
@media only screen and (max-width: 900px) {
.header-image .site-title a {
min-height: 95px; /* You need to allow more space for the logo if you're doing this so increase the min-height to suit */
}
.header-image .site-header .wrap {
/* background-size: 93px 48px;*/ /* Removes image resizing completely, otherwise you can uncomment it and adjust the size manually by changing the values (making sure to keep it in proportion to the original image */
}
}
@nickdavis
nickdavis / style.css
Last active November 10, 2016 18:19
Attempt to override Kickstart Pro default backstretch effect with CSS to make image react to width of page (not tested / designed to work with a slider on the homepage)
.before-content {
height: auto;
margin-bottom: -124px;
margin-top: 0;
top: -124px;
}
.backstretch,
.backstretch img {
height: auto !important;