Skip to content

Instantly share code, notes, and snippets.

View eugenoprea's full-sized avatar

Eugen Oprea eugenoprea

View GitHub Profile
@eugenoprea
eugenoprea / functions.php
Created February 3, 2013 00:44
Genesis - Move the Comments List Below the Comment Form
/** Move Genesis Comments */
add_action( 'genesis_before_comments' , 'eo_move_comments' );
function eo_move_comments ()
{
if ( is_single() && have_comments() )
{
remove_action( 'genesis_comment_form', 'genesis_do_comment_form' );
add_action( 'genesis_comments', 'genesis_do_comment_form', 5 );
}
}
@eugenoprea
eugenoprea / functions.php
Created February 3, 2013 01:01
How to Change the WordPress Login Logo
/** Change the WordPress Login Logo */
add_action('login_head', 'eo_login_logo');
function eo_login_logo()
{
echo
'<style type="text/css">
login h1 a
{
background-image: url(' . get_bloginfo('template_directory') . '/images/login-logo.png) !important;
}
@eugenoprea
eugenoprea / functions.php
Created February 3, 2013 01:12
How to Change the WordPress Login Logo URL
/** Change Powered by WordPress */
add_filter('login_headertitle', 'eo_login_logo_url_desc');
function eo_login_logo_url_desc()
{
return bloginfo('name');
}
@eugenoprea
eugenoprea / functions.php
Created February 3, 2013 01:24
Genesis - Customize Post Info - Remove Post Info
/** Remove Post Info */
remove_action('genesis_before_post_content', 'genesis_post_info');
@eugenoprea
eugenoprea / functions.php
Last active December 12, 2015 02:38
Genesis - Customize Post Info
/** Customize Post Info */
add_filter('genesis_post_info', 'eo_post_info_filter');
function eo_post_info_filter($post_info)
{
if ( ! is_page() )
{
$post_info = 'Written by [post_author_posts_link] on [post_date] at [post_time]';
return $post_info;
}
}
@eugenoprea
eugenoprea / functions.php
Created February 3, 2013 01:30
How to Customize the Genesis Footer - Return to Top of Page
/** Customize the Return to Top of Page */
add_filter('genesis_footer_backtotop_text', 'eo_custom_footer_backtotop');
function eo_custom_footer_backtotop($backtotop)
{
$backtotop = '<a href="#wrap" rel="nofollow">Click to Go Up</a>';
return $backtotop;
}
@eugenoprea
eugenoprea / style.css
Created February 3, 2013 01:35
Center Align Footer Text
#footer
{
text-align: center;
}
@eugenoprea
eugenoprea / functions.php
Created February 3, 2013 01:32
How to Customize the Genesis Footer - Credits
/** Customize the credits */
add_filter('genesis_footer_creds_text', 'eo_custom_footer_creds');
function eo_custom_footer_creds()
{
echo '<div class="creds"><p>';
echo 'Copyright &copy; ';
echo date('Y');
echo ' &middot; <a href="http://www.myawesomewebsite.com">My Awesome Website</a> &middot; Powered by <a href="http://www.eugenoprea.com/" title="Eugen Oprea">Eugen Oprea</a>';
echo '</p></div>';
}
@eugenoprea
eugenoprea / functions.php
Created February 3, 2013 01:57
Genesis - How to Change Text Shown When No Posts Are Found
/** Change Text Shown When No Posts Are Found */
add_filter('genesis_noposts_text', 'eo_noposts_text');
function eo_noposts_text($text)
{
$text = '<span class="noposts-text">' . __('Your request did not return any results, please check back later.', 'eo') . '</span>';
return $text;
}
@eugenoprea
eugenoprea / functions.php
Last active December 12, 2015 02:38
Genesis - Custom Post Class
// Add custom post class to posts in the "Featured" category
add_filter('post_class', 'eo_custom_post_class');
function eo_custom_post_class($classes)
{
$new_class = 'featured-post';
if (in_category('Featured'))
$classes[] = esc_attr(sanitize_html_class($new_class));
return $classes;
}