Skip to content

Instantly share code, notes, and snippets.

View epicdaze's full-sized avatar

Daze epicdaze

View GitHub Profile
@epicdaze
epicdaze / gist:1023973
Created June 13, 2011 23:20
#wordpress - comments are closed #comments
<!-- /* use this to add a conditional "comments are closed" notice */ -->
<?php comments_open();
if ('closed' == $post->comment_status) : ?>
<?php _e('Comments are closed',themedomain); ?>
<?php endif; ?>
@epicdaze
epicdaze / gist:1026011
Created June 14, 2011 21:54
#wordpress - comments are closed #ifelse #comments
<!-- /* use this to show if comments are open or closed */ -->
<?php comments_open();
if ('closed' == $post->comment_status)
{ _e('Comments are closed',themedomain); }
else
{ _e('Comments are open',themedomain); }
?>
@epicdaze
epicdaze / gist:1026324
Created June 15, 2011 01:38
#wordpress - add nofollow to comments link #comments #attribute #nofollow
<!-- /* add this to the theme's functions.php to add rel="nofollow" atribute to comments link */ -->
<?php function add_nofollow_to_comments_popup_link ()
{ return 'rel="nofollow"'; }
add_filter ( 'comments_popup_link_attributes', 'add_nofollow_to_comments_popup_link' );
?>
@epicdaze
epicdaze / gist:1026630
Created June 15, 2011 07:16
#wordpress - correct comments link title translation #localization #L10n #comments #title #correction
<!-- /*
Correction for the french localization of comments_popup_link() function in WordPress 3.1 core:
Official translation: « Comment on get_the_title() » becomes « Commentaire sur get_the_title() »
I would instead prefer: « Commentaires sur get_the_title() » or « Commentez sur get_the_title() »
Reference:
wp-includes/comment-template.php:1014
msgid "Comment on %s"
msgstr "Commentaire sur %s"
@epicdaze
epicdaze / gist:1028544
Created June 16, 2011 02:04
#wordpress - display published post count #postcount #post #count
<!-- /* This simple one line snippet will display the total wordpress post count. */ -->
<?php echo wp_count_posts()->publish; ?>
@epicdaze
epicdaze / gist:1029717
Created June 16, 2011 17:13
#wordpress - load child theme language files #language #localization #L10n #childtheme
<!-- /* To load language files from a subfolder in a theme child, add this in its functions.php file: */ -->
<?php
load_child_theme_textdomain('parentThemeFolderName', dirname(__FILE__).'/languageSubfolderNameInChildTheme');
?>
@epicdaze
epicdaze / gist:1030784
Created June 17, 2011 03:02
#facebook - facebook share #social #share
<!-- /* hardcoded link to share a URL on facebook */ -->
<a href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fexample.com">Share on Facebook</a>
@epicdaze
epicdaze / gist:1030943
Created June 17, 2011 06:11
#wordpress - remove wordpress version number #obfuscate #version
<!-- /* Remove version number from wordpress generated source and RSS feed.
http://www.wpbeginner.com/wp-tutorials/the-right-way-to-remove-wordpress-version-number/
*/ -->
<!-- /* remove this from header.php remove version from generated page source */ -->
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
<!-- /* or add this to functions.php to remove version from generated page source */ -->
<?php remove_action('wp_head', 'wp_generator'); ?>
@epicdaze
epicdaze / gist:1030967
Created June 17, 2011 06:41
#github-gist - gist.gisthub compact #stylish
h2 {margin:0 0 2px !important}
h3 {margin:4px 0 !important}
.topsearch {width:auto !important; margin-top:6px !important; margin-right: 4px}
.userbox {height:20px !important}
.userbox > .inner {height:auto !important; padding:1px 4px 0 !important}
.site {padding:0 4px 0 4px !important}
.main {width:79% !important}
.secondary {width:19.9% !important; margin-right:4px !important}
.push {display:none}
@epicdaze
epicdaze / gist:1032786
Created June 18, 2011 03:59
#wordpress - enable adminbar in custom theme #theme #adminbar
<!-- /* this should placed in header.php in the <head> section (if it isn’t already) to enable plugins and admin bar functionality */ -->
<?php wp_head();?>
<!-- /* this should be placed in footer.php right before </body> to insert the actual html for the admin bar */ -->
<?php wp_footer(); ?>