Last active
December 21, 2015 16:59
-
-
Save alnutile/6337116 to your computer and use it in GitHub Desktop.
Instructions can be seen here https://dl.dropboxusercontent.com/u/54803135/larry_settings.txt
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
/** | |
* File Path | |
* themes/incrediblewp/template-portfolio4col-content.php | |
* This is the alter pages that are Wordpress Pages that then have under it the | |
* Template 4 column like the parking url. | |
*/ | |
// Line 123 | |
<?php | |
$excerpt = get_the_excerpt(); | |
$permalink = get_permalink(); | |
$short_excerpt = string_limit_words($excerpt, 50, $permalink); | |
if(ot_get_option('incr_portfolio_text')== 'excerpt') { | |
echo '<p>'.$excerpt.'</p>'; | |
} else { | |
echo '<p>'.$short_excerpt.'</p>'; | |
} | |
?> |
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 | |
//Path | |
//themes/incrediblewp/backend/helpers.php | |
function string_limit_words($string, $word_limit, $link) { | |
$words = explode(' ', $string, ($word_limit + 1)); | |
if (count($words) > $word_limit) { | |
array_pop($words); | |
//I added the Read More option | |
return implode(' ', $words) . "... <a href=\"$link\">Read More..</a>"; | |
} else { | |
//otherwise | |
return implode(' ', $words); | |
} | |
} | |
?> |
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 | |
//Path | |
//themes/incrediblewp/helpers.php | |
$excerpt = get_the_excerpt(); | |
$permalink = get_permalink(); | |
$short_excerpt = string_limit_words($excerpt,50, $permalink); | |
if(ot_get_option('incr_portfolio_text')== 'excerpt') { | |
echo '<p>'.$excerpt.'</p>'; | |
} else { | |
echo '<p>'.$short_excerpt.'</p>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment