Jump to content
Sign in to follow this  
geographyblog

How to change the background of a post and change the excerpt limit.

Recommended Posts

geographyblog

I wanted to know if it is possible to change the colour that surrounds each post on my homepage, and leaving the background colour the same. Therefore there would be a significant difference between each post not just the thin horizontal line at current. Also is it possible to set different excerpt limits for the feature slider, and then the featured posts below. My website: www.geographyblog.eu Thanks

Share this post


Link to post
Share on other sites
catrina
You can change each post background color on the homepage by adding this CSS to Custom Code > Custom CSS: [code]#post {background-color: #XXXXXX;}[/code] Replace XXXXXX with the hex code color you desire. You can set a different excerpt lengths using this filter which could be added to the functions.php file in the PlatformBase child theme: http://codex.wordpress.org/Function_Reference/the_excerpt#Control_Excerpt_Length_using_Filters

Please read the docs before posting. Please do not private message me unless I ask you to.

Designer | Catrina Dulay

Founder | Catrina and Mouse

Share this post


Link to post
Share on other sites
geographyblog
Thanks Catrina, I tried entering the code in the custom code area but it made no difference the background to each post is still white, any other suggestions would be great.

Share this post


Link to post
Share on other sites
geographyblog
Also is there a way to set different excerpt lengths for the feature, and then the posts displayed in the posts pages.

Share this post


Link to post
Share on other sites
Jenny
Try using: (full-width posts) [code].fpost { background-color: #000000; margin-bottom: 1.6em; padding: 10px 10px 0 10px; }[/code] (post clips) [code].clip_box { background-color: #000000; margin-bottom: 0.5em; padding: 1em 0; }[/code] Change the background color and adjust the sizing as needed. You can change the excerpt using functions.php but you will need to make sure you are using the child theme, PlatformBase, from now on (if you aren't already). Just add this to your functions.php in PlatformBase: [code]// Excerpt length filter function new_excerpt_length($length) { return 24; } add_filter('excerpt_length', 'new_excerpt_length');[/code] I am unsure if you can be selective on where this excerpt length displays, but for features, you could always just limit the number of characters/words manually (i.e. type in the box exactly as it should be displayed). Hope that helps!

Jenny :: Web designer at Simple Mama (follow me at @simplemamacom)

Check out Share Me, a social sharing add-on for DMS that is super simple to set up.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×