Styling featured post text on front page ?

Community Forums Forums Design Tips and Tricks Styling featured post text on front page ?

This topic is: not resolved

This topic contains 8 replies, has 3 voices, and was last updated by  Boblebad 1 year, 3 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #51815

    Boblebad
    Participant
    Post count: 64

    Hi

    I’m having trouble figuring out how to style the text on the front page, the featured post.

    http://www.gittehovmand.dk/

    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
    Carsten

    http://www.gittehovmand.dk/
    #51816

    Debra Scott
    Moderator
    Post count: 132

    When 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

    #51860

    Boblebad
    Participant
    Post count: 64

    So 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.

    • This reply was modified 1 year, 3 months ago by  Boblebad.
    • This reply was modified 1 year, 3 months ago by  Boblebad.
    • This reply was modified 1 year, 3 months ago by  Boblebad.
    • This reply was modified 1 year, 3 months ago by  Boblebad.
    #51868

    braddalton
    Participant
    Post count: 10263

    You 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.


    #51872

    Boblebad
    Participant
    Post count: 64

    Thank 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>,

    • This reply was modified 1 year, 3 months ago by  Boblebad.
    • This reply was modified 1 year, 3 months ago by  Boblebad.
    #51875

    Boblebad
    Participant
    Post count: 64

    Hmm, 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…

    #51941

    braddalton
    Participant
    Post count: 10263

    Click, 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?


    #51987

    Boblebad
    Participant
    Post count: 64

    The 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.

    • This reply was modified 1 year, 3 months ago by  Boblebad.
    • This reply was modified 1 year, 3 months ago by  Boblebad.
    #51992

    Boblebad
    Participant
    Post count: 64

    Regarding 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…

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.