This file contains hidden or 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
| /* when logged in, expand latest tweet instead of truncated version */ | |
| div.latest-tweet .tweet-content, | |
| div.latest-tweet .tweet-row, | |
| div.truncated-tweet .tweet-row {height: 60px !important;} | |
| div.latest-tweet .tweet-row, div.truncated-tweet .tweet-row {white-space: normal !important;} |
This file contains hidden or 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
| <!-- /* customized and valid twitter share button using asynchronous document.write */ --> | |
| <!-- /* inspired from http://techoctave.com/c7/posts/40 and gist:1059744 and gist:1059498 */ --> | |
| <script type="text/javascript"> | |
| //<![CDATA[ | |
| (function() { | |
| document.write('<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" data-via="twitter_username" ' | |
| +'data-text=\'Article#<?php the_ID(); echo": "; the_title(); $tags = get_the_tags(); $tags_hashed = array(); foreach((array)$tags as $tag) $tags_hashed[] = str_replace(" ", "", $tag->name); echo " #".implode(" #", $tags_hashed); ?>\' ' | |
| +'data-url="<?php bloginfo('url'); ?>/<?php the_ID(); ?>" data-lang="en">Tweet this</a> '); | |
| var s = document.createElement('SCRIPT'), s1 = document.getElementsByTagName('SCRIPT')[0]; |
This file contains hidden or 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
| <!-- /* Twitter button: post title and post tags. Prepend tags with hash symbol and remove whitespace within tags. */ --> | |
| <a href="http://twitter.com/share" | |
| class="twitter-share-button" | |
| data-url="<?php bloginfo('url'); ?>/<?php the_ID(); ?>" | |
| data-text="<?php the_title(); | |
| // remove whitespace inside tags and prepend with # | |
| $tags = get_the_tags(); | |
| $tags_hashed = array(); | |
| foreach((array)$tags as $tag) |
This file contains hidden or 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
| <!-- /* http://wordpress.stackexchange.com/questions/21707/ */ --> | |
| <?php | |
| $tags = get_the_tags(); | |
| $tag_links = array(); | |
| foreach((array)$tags as $tag) | |
| $tag_links[] = str_replace(' ', '', $tag->name); |
This file contains hidden or 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 excerpt functionality to pages. From: http://wordpress.mfields.org/2010/excerpts-for-pages-in-wordpress-3-0/ */ --> | |
| <?php add_post_type_support( 'page', 'excerpt' ); ?> | |
| <!-- /* To activate, click on the ‘screen options’ tab near the top right when editing a page. There is a checkbox for Excerpts. */ --> | |
This file contains hidden or 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
| <!-- /* 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(); ?> | |
This file contains hidden or 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
| <!-- /* 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'); ?> |
This file contains hidden or 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
| <!-- /* 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'); | |
| ?> |
This file contains hidden or 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
| <!-- /* This simple one line snippet will display the total wordpress post count. */ --> | |
| <?php echo wp_count_posts()->publish; ?> |
This file contains hidden or 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 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' ); | |
| ?> |
NewerOlder