Skip to content

Instantly share code, notes, and snippets.

View eugenoprea's full-sized avatar

Eugen Oprea eugenoprea

View GitHub Profile
@eugenoprea
eugenoprea / .htaccess
Created February 3, 2013 01:46
Default WordPress .htaccess for "Pretty" permalinks
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
@eugenoprea
eugenoprea / functions.php
Created February 3, 2013 01:44
Genesis - How to Display Custom Taxonomy Terms - Display Taxonomy Terms
// taxonomy terms will be displayed after the post content (notice the priority of 50)
add_action ('genesis_post_content', 'eo_display_taxonomy_terms', 50);
function eo_display_taxonomy_terms()
{
// replace with the slugs of your custom taxonomies
$taxonomy1 = 'taxonomy1';
$taxonomy2 = 'taxonomy2';
$other_taxonomies = array('taxonomy3', 'taxonomy4');
// display all terms from the first taxonomy separated by commas, with each term linking to that term's archive page
@eugenoprea
eugenoprea / functions.php
Created February 3, 2013 01:42
Genesis - How to Display Custom Taxonomy Terms - Helper Function
/**
* Returns the given number of terms from the specified taxonomies (for the current post).
*
* @param (string|array) $taxonomies The taxonomy(es) to retrieve terms from
* @param (int) $term_number Limit the number of terms returned (-1 for no limit)
* @param (bool) $term_links Whether to return links to term archives or not
* @param (string) $separator String that will be used as the terms separarator
* @return (string) The list of taxonomy terms for the current post or empty string
*/
function eo_get_tax_terms($taxonomies, $term_number = -1, $term_links = true, $separator = ', ')
@eugenoprea
eugenoprea / style.css
Created February 3, 2013 01:35
Center Align Footer Text
#footer
{
text-align: center;
}
@eugenoprea
eugenoprea / functions.php
Last active May 17, 2016 15:23
How to Customize the Genesis Footer
/** Customize the entire footer */
remove_action('genesis_footer', 'genesis_do_footer');
add_action('genesis_footer', 'eo_custom_footer');
function eo_custom_footer()
{
echo '<p>';
echo 'Copyright &copy; ';
echo '2011 - ';
echo date('Y');
echo ' &middot; <a href="http://www.eugenoprea.com/" title="Eugen Oprea">Eugen Oprea</a> &middot; All rights reserved';
@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: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 / 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: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 November 1, 2016 08:24
How to Change the WordPress Login Logo URL
/** Change the WordPress Login Logo URL */
add_filter('login_headerurl', 'eo_login_logo_url');
function eo_login_logo_url()
{
return bloginfo('url');
}