Skip to content

Instantly share code, notes, and snippets.

View Losgard's full-sized avatar

Patrik Losgard Losgard

View GitHub Profile
@Losgard
Losgard / search-form-input-box.php
Last active August 29, 2015 14:25 — forked from studiopress/search-form-input-box.php
Genesis search form.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Customize search form input box text
add_filter( 'genesis_search_text', 'sp_search_text' );
function sp_search_text( $text ) {
return esc_attr( 'Search my blog...' );
}
@Losgard
Losgard / disable-superfish.php
Last active August 29, 2015 14:25 — forked from studiopress/disable-superfish.php
Genesis scripts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Disable the superfish script
add_action( 'wp_enqueue_scripts', 'sp_disable_superfish' );
function sp_disable_superfish() {
wp_deregister_script( 'superfish' );
wp_deregister_script( 'superfish-args' );
}
@Losgard
Losgard / next-page.php
Last active August 29, 2015 14:25 — forked from studiopress/next-page.php
Genesis post navigation.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Customize the next page link
add_filter ( 'genesis_next_link_text' , 'sp_next_page_link' );
function sp_next_page_link ( $text ) {
return 'Custom Next Page Link &#x000BB;';
}
@Losgard
Losgard / customize.php
Last active August 29, 2015 14:25 — forked from studiopress/customize.php
Genesis post meta.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Customize the post meta function
add_filter( 'genesis_post_meta', 'sp_post_meta_filter' );
function sp_post_meta_filter($post_meta) {
if ( !is_page() ) {
$post_meta = '[post_categories before="Filed Under: "] [post_tags before="Tagged: "]';
return $post_meta;
}}
@Losgard
Losgard / customize.php
Last active August 29, 2015 14:25 — forked from studiopress/customize.php
Genesis post info.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Customize the post info function
add_filter( 'genesis_post_info', 'sp_post_info_filter' );
function sp_post_info_filter($post_info) {
if ( !is_page() ) {
$post_info = '[post_date] by [post_author_posts_link] [post_comments] [post_edit]';
return $post_info;
}}
@Losgard
Losgard / post-format-images.php
Last active August 29, 2015 14:25 — forked from studiopress/post-format-images.php
Genesis post formats.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add support for post format images
add_theme_support( 'genesis-post-format-images' );
@Losgard
Losgard / genesis-read-more.php
Last active August 29, 2015 14:25 — forked from studiopress/genesis-read-more.php
Genesis post excerpts.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Modify the Genesis content limit read more link
add_filter( 'get_the_content_more_link', 'sp_read_more_link' );
function sp_read_more_link() {
return '... <a class="more-link" href="' . get_permalink() . '">[Continue Reading]</a>';
}
@Losgard
Losgard / reposition-primary.php
Last active August 29, 2015 14:25 — forked from studiopress/reposition-primary.php
Genesis primary/secondary navigation.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Reposition the primary navigation menu
remove_action( 'genesis_after_header', 'genesis_do_nav' );
add_action( 'genesis_before_header', 'genesis_do_nav' );
@Losgard
Losgard / category-1.php
Last active August 29, 2015 14:25 — forked from studiopress/category-1.php
Genesis body class.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Add custom body class to the head
add_filter( 'body_class', 'sp_body_class' );
function sp_body_class( $classes ) {
if ( is_category( '1' ) )
$classes[] = 'custom-class';
return $classes;
@Losgard
Losgard / custom-favicon.php
Last active August 29, 2015 14:25 — forked from studiopress/custom-favicon.php
Genesis images.
<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.
//* Display a custom favicon
add_filter( 'genesis_pre_load_favicon', 'sp_favicon_filter' );
function sp_favicon_filter( $favicon_url ) {
return 'http://www.mydomain.com/wp-content/themes/genesis/images/favicon.ico';
}