Three or more hashtags.
#[^#]+#[^#]+#
Long hashtags (15+ characters): #hashtagpunchline
| // important: note the priority of 99, the js needs to be placed after tinymce loads | |
| // important: note that this assumes you're using http://wordpress.org/extend/plugins/verve-meta-boxes/ | |
| // to create the textarea - otherwise change your selector | |
| function admin_add_wysiwyg_custom_field_textarea() | |
| { ?> | |
| <script type="text/javascript">/* <![CDATA[ */ | |
| jQuery(function($){ | |
| var i=1; | |
| $('.verve_meta_box_content textarea').each(function(e) |
| <h1> | |
| This is the primary heading and there should only be one of these per page | |
| </h1> | |
| <p> | |
| A small paragraph to <em>emphasis</em> and show <strong>important</strong> bits. | |
| </p> | |
| <ul> | |
| <li>This is a list item | |
| </li> | |
| <li>So is this - there could be more |
| /** | |
| * Horizontal Type Line Behind Text | |
| * Inspired by this discussion @ CSS-Tricks: http://css-tricks.com/forums/discussion/comment/51357#Comment_51357 | |
| * Available on jsFiddle: http://jsfiddle.net/ericrasch/jAXXA/ | |
| * Available on Dabblet: http://dabblet.com/gist/2045198 | |
| * Available on GitHub Gist: https://gist.github.com/2045198 | |
| */ | |
| h2 { | |
| font: 33px sans-serif; |
| I needed to create some faux small caps that were only slightly smaller than the full cap. Font-variant was too drastic so instead I wrapped each word in a <span> set the span to inline-block and used :first-letter to increase the font-size of the first letter in each word. |
| <!-- New HTML5 FB Comments --> | |
| <div id="fb-root"></div> | |
| <script>(function(d, s, id) { | |
| var js, fjs = d.getElementsByTagName(s)[0]; | |
| if (d.getElementById(id)) return; | |
| js = d.createElement(s); js.id = id; | |
| js.src = "//connect.facebook.net/en_US/all.js#xfbml=1"; | |
| fjs.parentNode.insertBefore(js, fjs); |
| Simple jQuery script to set a sidebar to always span the height of a page. Required when the sidebar has a background, borders, or shadows. #main is the container for both the sidebar and content and can be replaced w/ any other element. It's important to use min-height, in case your sidebar has moving/changing elements that could resize it larger than the main content (or just happens to be larger than the main content). |
| /* =BEGIN: Check If Page Is Child | |
| Source: http://bavotasan.com/2011/is_child-conditional-function-for-wordpress/ | |
| ---------------------------------------------------------------------------------------------------- */ | |
| function is_child( $page_id_or_slug ) { // $page_id_or_slug = The ID of the page we're looking for pages underneath | |
| global $post; // load details about this page | |
| if ( !is_numeric( $page_id_or_slug ) ) { // Used this code to change a slug to an ID, but had to change is_int to is_numeric for it to work. | |
| $page = get_page_by_path( $page_id_or_slug ); | |
| $page_id_or_slug = $page->ID; | |
| } |
Creating a solid base for your .htaccess file. Currently includes RewriteBase, Security (against indexes, files, etc.), and Expires Headers (caching, performance).
wp-config.php| /* =BEGIN: Add Class to first Paragraph in WordPress the_content(); | |
| Source: http://wordpress.stackexchange.com/a/51682/28826 | |
| ---------------------------------------------------------------------------------------------------- */ | |
| function first_paragraph($content){ | |
| // Finding the 1st p tag and adding a class. | |
| $content = preg_replace('%<p([^>]+)?>%', '<p$1 class="intro">', $content, 1); | |
| // Finding the 1st closing p tag and adding a div tag to the rest of the content so we can separate it. | |
| $content = preg_replace('%</p>%', '</p> <div id="collapsable-content">', $content, 1); |