Community Forums › Forums › Archived Forums › Design Tips and Tricks › Styling featured post text on front page ?
Tagged: Delicious, featured post, style, text
- This topic has 8 replies, 3 voices, and was last updated 11 years, 8 months ago by
Boblebad.
-
AuthorPosts
-
July 22, 2013 at 4:41 am #51815
Boblebad
ParticipantHi
I'm having trouble figuring out how to style the text on the front page, the featured post.
There are no line breaks at all as in the original post, how come, and what can i do to get the post look nice ?
It's the Delicious theme, but i see the same on Agent theme
All the best
http://www.gittehovmand.dk/
CarstenJuly 22, 2013 at 5:02 am #51816Debra Scott
MemberWhen you are using the excerpt or content limit it takes away all html ie line breaks, formatting..
You can either use a custom excerpt which will get the original formatting. Or use the content with more tag.
http://codex.wordpress.org/Excerpt
need help with your business or personal website? Contact me at Fat Cat Designs
July 22, 2013 at 11:34 am #51860Boblebad
ParticipantSo what you're saying is that i need to use the more tag inside the post, to get the post excerpt look nice or ?
I use the more tag on the featured post widget.
July 22, 2013 at 12:06 pm #51868Brad Dalton
ParticipantYou can also add back the HTML formatting tags using this code snippet:
Please copy this PHP code from the view raw link and paste it at the end of your child themes functions.php file.
July 22, 2013 at 12:27 pm #51872Boblebad
ParticipantThank you Brad
But, it does not work, here you can see where i put it:
<?php
// Start the engine
require_once(TEMPLATEPATH.'/lib/init.php');// Child theme library
require_once(CHILD_DIR.'/lib/style.php');
require_once(CHILD_DIR.'/lib/widgets/delicious-slider-widget.php');// Child theme (do not remove)
define('CHILD_THEME_NAME', 'Delicious Theme');
define('CHILD_THEME_URL', 'http://www.studiopress.com/themes/delicious');// Tilbagefør stylen for featured post widget
add_filter( 'get_the_content_limit_allowedtags', 'get_the_content_limit_custom_allowedtags' );
/**
* @author Brad Dalton
* @example http://wp.me/p1lTu0-a5w
*/
function get_the_content_limit_custom_allowedtags() {
// Add custom tags to this string
return '<script>,<style>,<br>,,<i>,July 22, 2013 at 12:40 pm #51875Boblebad
ParticipantHmm, don't know why i can't insert the code, so it gets displayed right, first i tried the code-"tag", but didn't work either...
July 22, 2013 at 4:56 pm #51941Brad Dalton
ParticipantClick, This Gist and copy it from the view raw link
Then paste it at the end of your child themes functions.php file using a text editor like Notepad++
Tested the code and it works.
Don't add any code tags.
Are you using FTP or File Manager in cPanel to access the functions file?
July 23, 2013 at 12:34 am #51987Boblebad
ParticipantThe problem with inserting the code, is here in the forum, not in the code in functions.php
Are you sure it works with the Featured Post widget in the Delicious theme, cause i can't get it to work, and it looks exactly like in here ?
I did it through the Dashboard in WP.
Regarding the widget, it doesn't make any difference whether i use "excerpt" or "content limit", just a matter of button.
July 23, 2013 at 1:42 am #51992Boblebad
ParticipantRegarding using the excerpt function in WP settings/reading, it does give some formatting, it gives line breaks, but not blank lines between lines of text, so the text is still somewhat cluttered together...
-
AuthorPosts
- The forum ‘Design Tips and Tricks’ is closed to new topics and replies.