This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Limit homepage to one category | |
* | |
*/ | |
function we_home_query( $query ) { | |
if( $query->is_main_query() && $query->is_home() && !is_admin() ) | |
$query->set( 'category_name', 'sample-category' ); | |
} | |
add_action( 'pre_get_posts', 'we_home_query' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Customize the 'Return to Top of Page' */ | |
add_filter( 'genesis_footer_backtotop_text', 'photos4life_footer_backtotop_text' ); | |
function photos4life_footer_backtotop_text($backtotop) { | |
$backtotop = '[footer_backtotop text="Back To Top"]'; | |
return $backtotop; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Reposition footer outside main wrap */ | |
remove_action( 'genesis_footer', 'genesis_footer_markup_open', 5 ); | |
remove_action( 'genesis_footer', 'genesis_do_footer' ); | |
remove_action( 'genesis_footer', 'genesis_footer_markup_close', 15 ); | |
add_action( 'genesis_after', 'genesis_footer_markup_open', 5 ); | |
add_action( 'genesis_after', 'genesis_do_footer' ); | |
add_action( 'genesis_after', 'genesis_footer_markup_close', 15 ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Add Login Link in Navigation | |
add_filter( 'wp_nav_menu_items', 'we_nav_login_right', 10, 2 ); | |
function we_nav_login_right($menu, $args) { | |
$args = (array)$args; | |
$login = wp_loginout( $_SERVER['REQUEST_URI'], false ); | |
$profile = '<a class="profile" href=' . get_edit_profile_url($userid) . '>Profile</a>'; | |
//if not primary, return | |
//change primary to secondary for secondary menu (though will need some CSS done) | |
if ( $args['theme_location'] != 'primary' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**** Toggle ****/ | |
$('.toggle').next('.toggle-content').hide(); | |
$('.toggle').click(function() { | |
$('.active').not(this).toggleClass('active').next('.toggle-content').slideToggle('slow'); | |
$(this).toggleClass('active').next().slideToggle('slow'); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/**** Truly Force Layout without allowing the User to Override the preferred/recommended layout ****/ | |
// Force Full Width Layout | |
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' ); | |
// Force Content-Sidebar Layout | |
add_filter( 'genesis_site_layout', '__genesis_return_content_sidebar' ); | |
// Force Sidebar-Content Layout | |
add_filter( 'genesis_site_layout', '__genesis_return_sidebar_content' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('manage_posts_columns', 'we_posts_columns_id', 5); | |
add_action('manage_posts_custom_column', 'we_posts_custom_id_columns', 5, 2); | |
add_filter('manage_pages_columns', 'we_posts_columns_id', 5); | |
add_action('manage_pages_custom_column', 'we_posts_custom_id_columns', 5, 2); | |
/** | |
* Add Post ID to posts, pages admin columns | |
* | |
*/ | |
function we_posts_columns_id($defaults){ | |
$defaults['we_post_id'] = __('ID'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'manage_edit-category_columns', 'we_categoriesColumnsHeader' ); | |
add_filter( 'manage_category_custom_column', 'we_categoriesColumnsRow', 10, 3 ); | |
/** | |
* Add Category ID column in admin | |
* | |
*/ | |
function we_categoriesColumnsHeader($columns) { | |
$columns['catID'] = __('ID'); | |
return $columns; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_action( 'admin_head-post.php', 'we_excerpt_count_js' ); | |
add_action( 'admin_head-post-new.php', 'we_excerpt_count_js' ); | |
/** | |
* Add Manual Excerpt Word Counter in Posts | |
* | |
*/ | |
function we_excerpt_count_js() { | |
echo '<script>jQuery(document).ready(function(){ | |
jQuery("#postexcerpt .handlediv").after("<div style=\"position:absolute;top:0px;right:5px;color:#666;\"><small>Excerpt length: </small><input type=\"text\" value=\"0\" maxlength=\"3\" size=\"3\" id=\"excerpt_counter\" readonly=\"\" style=\"background:#fff;\"> <small>word(s).</small></div>"); | |
jQuery("#excerpt_counter").val(jQuery("#excerpt").val().split(/\S+\b[\s,\.\'-:;]*/).length - 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'excerpt_more', 'we_read_more_link' ); | |
add_filter( 'get_the_content_more_link', 'we_read_more_link' ); | |
add_filter( 'the_content_more_link', 'we_read_more_link' ); | |
/** | |
* Customize Read More on Excerpts | |
* | |
*/ | |
function we_read_more_link() { | |
return '<a class="more-link" href="' . get_permalink() . '"> [More …]</a>'; | |
} |
OlderNewer