Skip to content

Instantly share code, notes, and snippets.

@studiopress
studiopress / functions.php
Last active December 19, 2015 07:19
Sixteen Nine site initials.
<?php
//* Do NOT include the opening php tag shown above. Copy the code below to the end of your functions.php file.
//* Customize the site initials
add_action( 'genesis_header', 'sixteen_nine_site_initials', 5 );
function sixteen_nine_site_initials() {
echo '<div class="site-initials"><a href="' . home_url( '/' ) . '">16.9</a></div>';
}
@studiopress
studiopress / functions.php
Last active December 19, 2015 07:19
Sixteen Nine site footer.
<?php
//* Do NOT include the opening php tag shown above. Copy the code below to the end of your functions.php file.
//* Customize the footer
add_action( 'genesis_header', 'sixteen_nine_custom_footer', 12 );
function sixteen_nine_custom_footer() {
echo '<p>Proudly running on the <a href="http://www.studiopress.com/">Genesis Framework</a></p>';
}
@studiopress
studiopress / 3-footer-widgets.php
Last active December 20, 2015 02:29
Add Footer Widgets
@studiopress
studiopress / custom-readmore-excerpt.php
Last active April 16, 2019 14:23
Add Read More Link for Automatic and Custom Excerpts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add Read More Link to Automatic and Custom Excerpts Site-wide
add_filter( 'the_excerpt', 'sp_read_more_custom_excerpt' );
function sp_read_more_custom_excerpt( $text ) {
if ( strpos( $text, '[&hellip;]') ) {
$excerpt = str_replace( '[&hellip;]', '<a class="more-link" href="' . get_permalink() . '">[Read More&hellip;]&hellip;</a>', $text );
} else {
@studiopress
studiopress / add-1.php
Last active December 20, 2015 16:09
Manually Updating to AgentPress v1.0.1 and changing the Slider
<?php
//* Add the following code to functons.php - replaces code from remove-3.php
/** Add the slider on the homepage above the content area */
add_action('genesis_after_header', 'agentpress_include_slider');
function agentpress_include_slider() {
if(is_front_page())
dynamic_sidebar( 'slider' );
}
@studiopress
studiopress / eleven40pro.html
Last active December 20, 2015 16:49
eleven40 Pro User Profile Widget Contents
<img src="http://www.mysite.com/path/to/your/profile.jpg" alt="Profile Image" />
Starbucks Addict. Nomad Theorist. Loving Husband. Sarah McLachlan Fan. Future Ironman.
Founder, StudioPress. Partner, Copyblogger Media.
<a href="http://www.mysite.com/aboutme/">More.</a>
@studiopress
studiopress / functions.php
Last active August 11, 2016 06:22
Add HTML5 markup structure.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add HTML5 markup structure
add_theme_support( 'html5', array( 'search-form', 'comment-form', 'comment-list', 'gallery', 'caption' ) );
@studiopress
studiopress / custom-viewport.php
Last active January 1, 2020 04:41
Add viewport meta tag.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add custom Viewport meta tag for mobile browsers
add_action( 'genesis_meta', 'sp_viewport_meta_tag' );
function sp_viewport_meta_tag() {
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0"/>';
}
@studiopress
studiopress / text-widget.html
Created August 17, 2013 02:32
Going Green Pro Text Widget
This is an example of a widget which can be used to describe a product or service.
You can also use widgets such as Featured Posts, Genesis eNews and Updates, Latest Tweets or even display a Custom Menu.
<a href="/sample">Learn more about the Going Green theme.</a>
@studiopress
studiopress / footer-widget-1.html
Last active December 22, 2015 03:09
Metro Pro Theme Widget Areas