Learn how to control the excerpt sizes for teasers in this tutorial for Thesis.
Thesis is an amazing theme (more of a framework) for wordpress which can give you easy control on the look and feel of your website / blog. Where Thesis becomes really attractive is how it offers its users various SEO functions to adjust and tweak!
Examples and screenshots are shown for Thesis Version 1.8
Teasers are those small boxes that appear by default in the Thesis theme. This is an example of a teaser found in this website -
As show in the image above, if you wish to control the length of the excerpt shown in the teaser, you can over-ride the default length by writing a small function in the custom_functions which can be found under the custom folder which is under the thesis folder on your website. This image should help -
Once you open the custom_functions.php, you need to type the following code inside it (The description of the code is written in comments -
/*declaring a new function called new_excerpt_length that takes an argument called 'length'*/
/*specifying the length of the excerpt aka giving the length variable a value*/
function new_excerpt_length($length) {
return 30;
}
/*adding this new function to the thesis framework*/
add_filter('excerpt_length', 'new_excerpt_length');
Done! Change the excerpt length to whatever you want it to be.
Hope you enjoyed this tutorial!! If you have any questions at all – feel free to post it in the comments and I’ll get back to you!
Check out the other Thesis tutorials in this website -
Thesis tutorial part 1 : installation of the Thesis theme
Thesis tutorial part 2 : learning about customizing
Thesis tutorial part 3 : HOOKS + custom function (Footer Text)
Pingback: Thesis Tutorial 1 : Installation of the thesis theme
Pingback: Thesis Tutorial Part 2 : Learning about Customizing
Pingback: Thesis tutorial part 3 : HOOKS + custom function (Footer Text)
Pingback: Thesis tutorial Part 5: adding different ribbons in blog post | Love For Tech
Pingback: Thesis tutorial part 4: custom footer + CSS styling | Love For Tech