WP Smith

Creating WordPress & Genesis Websites Since 2010

  • Home
  • About
  • Services
  • Blog
  • Contact

Apr 22 2011

How to Add Formatting Tags to Genesis's Content Limit in Content Archives

Recently, I started limiting my content by using Display Post Content under Genesis > Theme Settings > Content Archives instead of using Display Post Excerpt. While the default is Display Post Content, the next field Limit content to ## characters is usually blank. However, I wanted to limit the content archives while maintaining my formacodeing.

So, upon limiting my content, I discovered that this actually strips all the tags except <code><script></code> and <code><style></code>. However, I wanted to allow basic formacodeing tags like <code><b></code>, <code><em></code>, and <code><br></code>. Gratefully, Genesis has a filter that will allow you to keep these tags in the content limit. To add the tags, you will need to add a filter in your functions.php.

[php]
add_filter('get_the_content_limit_allowedtags', 'get_the_content_limit_custom_allowedtags');
function get_the_content_limit_custom_allowedtags() {
return '<script>,<style>,<b>,<br>,<em>'; //add whatever tags you want to this string
}
[/php]

Written by Travis Smith · Categorized: Genesis, Tutorials

StudioPress Premium WordPress Themes     WP Engine Managed WordPress Hosting

What can I do for you!?

Custom Development

We develop plugins by determining both business/functional and technical requirements, following WordPress development best practices, and using agile methodology to ensure you get the best solution.

Consulting

Have questions? Need a reliable developer to consult? Please contact us today!

Customized Theme

We can customize your theme or child theme, or create a child theme for you based on your needs while enhancing the performance of every individual attribute.

Customized Plugin

We can customize your plugins, extend plugins (e.g., Gravity Forms, Jetpack, Soliloquy) based on your needs ensuring security, performance, and positive business impact.

Contact Us

About Travis Smith

As a WordPress enthusiast, developer, and speaker, Travis writes about what he learns in WordPress trying to help other WordPress travelers, beginners and enthusiasts with tutorials, explanations, & demonstrations.

Comments

  1. Nicolas says

    January 2, 2013 at 6:29 am

    Awesome Travis, thank you so much for that piece of code. Exactly what I was looking for!
    Cheers,
    Nicolas.

    Reply
  2. JM says

    January 26, 2013 at 5:58 am

    Works like a charm! Great work.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Twitter
  • Facebook
  • LinkedIn
  • Google+
  • RSS

Copyright © 2025 � WP Smith on Genesis on Genesis Framework � WordPress � Log in