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
| <? | |
| //=========================================================== SUBSCRIBER SHORTCODE | |
| function subscriber_shortcode($atts, $content = null ) { | |
| extract(shortcode_atts(array( | |
| 'page' => '', | |
| 'headline' => 'Subscribe for free updates', | |
| 'button' => 'Subscribe', | |
| 'quote' => '', | |
| 'class' => 'box_main', | |
| 'form_class' => 'centered_form', |
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
| <?php | |
| //=========================================================== Grab first paragraph (two if first is not long enough) | |
| function get_first_two_paragraphs(){ | |
| global $post; | |
| $str = wpautop( get_the_content() ); | |
| $psToGrab = 2; // number of paragraphs to get | |
| $maxFirstParaLength = 200; // character max in first paragraph | |
| $matches = array(); // matching elements will go here | |
| $pattern = '%<p[^>]*>(.*?)</p>%i'; // match what's between all <p> tags | |
| preg_match_all($pattern, $str, $matches); // do the regex match |
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
| // [podsc url="069-work-for-yourself-or-for" hrtop="" hrbottom="" btn_top=""] | |
| function podsc($atts) { | |
| extract(shortcode_atts(array( | |
| "url" => '', | |
| "hrtop" => 'true', | |
| "hrbottom" => 'true', | |
| "btn_top" => '' | |
| ), $atts)); | |
| // remove intro bits of URL if it's in the shortcode |
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
| // [quotable]"Here's my quote."[/quotable] | |
| // [quotable link="" class="" link_class=""]"Here's my quote."[/quotable] | |
| // if link says 'no', use only content, no permalink | |
| //=========================================================== TWEET THIS SHORTCODE | |
| function quotable_shortcode( $atts, $content = null ) { | |
| extract(shortcode_atts(array( | |
| 'class' => 'no_lede', | |
| 'link' => '', | |
| 'link_class' => '', | |
| ), $atts)); |
OlderNewer