Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBrandon Brigham
3,716 PointsHow to customize recent blog posts on Salient wordpress theme
Hello,
Please visit this page: http://fourandhalf.com/home-page-mockup/
At the very bottom is a section with 3 of the most recent blog posts laid out. I am trying to remove the 30 character excerpt from the blogs here BUT ONLY for this particular page. I know how to change the character limit down to zero for the entire site but I don't want this. I want zero characters only on this particular page.
Any ideas?
Thanks for your time!
1 Answer
Mark Truitt
17,230 PointsHi Brandon,
You would have to write a conditional for that based on ID or title.
Below is an example. However, if it is strictly going to be frontpage/homepage there are additional/other ways to write it.
You would still need to include this within the function/add_filter.
<?php
if ( is_page ( 42 ) ) {
$length = 0;
else
$length = 30;
}
return $length
?>
Mark