Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #254159

    Shark Bite
    Participant

    I want to format the recent posts layout to display a thumbnail or icon on the left side while the title, excerpt, etc is on the right side. Which file do I edit for this?

    I looked at http://theme.co/x/demo/integrity/1/shortcodes/recent-posts/ but it’s not what I was looking for.

    An example that I have in mind is:

    #254273

    Rue Nel
    Moderator

    Hello There,

    Thanks for posting in!

    To format the recent posts layout to display a thumbnail or icon on the left side while the title, etc is on the right side, please add the following css code in the customizer, Appearance > Customize > Custom > CSS

    .x-recent-posts .x-recent-posts-img {
        float: left;
        width: 30%;
    }
    
    .x-recent-posts .x-recent-posts-content {
        float: left;
        width: 68%;
        margin-left: 2%;
    }
    
    .x-recent-posts a {
        padding: 5px;
    }
    
    .x-recent-posts.horizontal .with-image .x-recent-posts-content {
        padding-top: 0;
    }
    
    .x-recent-posts.vertical a {
        box-shadow: none;
        border-radius: 0;
        padding-bottom: 6%;
        border: none;
        border-bottom: solid 2px #e5e5e5;
    }
    
    .x-recent-posts.vertical a:last-child {
        border: none;
    }
    
    .x-recent-posts article.hentry>.entry-wrap:after {
        content: " ";
        display: block;
        clear: both;
        height: 0;
    }

    To add the excerpt in your recent post shortcode, please refer to this post: https://theme.co/x/member/forums/topic/add-excerpt-to-recent-posts-shortcode/#post-66964

    Hope this helps. Kindly let us know.

    #254361

    Shark Bite
    Participant

    I added the excerpt but it’s not working. Do it has something to do with adding the recent posts to the text area in widget? Also what is the green circle in the img? I added a image to .x-recent-posts .x-recent-posts-img {
    float: left;
    width: 30%;
    }
    And it’s showing a green circle with an document icon inside. How do I fix it?

    #254549

    Paul R
    Moderator

    Hi,

    To further assist you with this issue, we’ll first need you to provide us with your URL. This is to ensure that we can provide you with a tailored answer to your situation. Once you have provided us with your URL, we will be happy to assist you with everything.

    Thanks

    #255257

    Shark Bite
    Participant
    This reply has been marked as private.
    #255260

    Shark Bite
    Participant

    Never mind about the excerpt. I figured out the problem with excerpt. But I still couldn’t figure out how to fix the thumbnail.

    #255426

    Christian
    Moderator

    Please add the code below in your Appearance > Customize > Custom > CSS.

    .x-recent-posts .format-standard .x-recent-posts-img:before {
      display: none;
    }
    
    .x-recent-posts .x-recent-posts-content {
      padding: 0 0.75em 0.775em;
    }

    I’ve added the recent post content padding code to eliminate the space above the recent post title so it’ll look good.

    Thanks.

    #256029

    Shark Bite
    Participant

    Thanks! I tried to edit the excerpt length so as to limit the amount of excerpt show with the link “Read More” to show, but nothing is working. I edit the excerpt length in the blog section in customizer. How do I fix it?

    #256199

    Lely
    Moderator

    Hello There,

    Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:

    – Link to your site
    – WordPress Admin username / password

    Don’t forget to select Set as private reply. This ensures your information is only visible to our staff.

    Meanwhile, you can check the thread on this post:https://theme.co/x/member/forums/topic/blog-excerpt-formatting/

    Hope this helps.
    Thanks

    #256270

    Shark Bite
    Participant
    This reply has been marked as private.
    #256369

    Rad
    Moderator

    Hi Shark,

    Could you try adding this code at your child theme’s functions.php with your own excerpt length.

    function custom_excerpt_length( $length ) {
    	return 20;
    }
    add_filter( 'excerpt_length', 'custom_excerpt_length', 999 );

    Thanks!

    #256723

    Shark Bite
    Participant

    Okay the excerpt with read more works now. But I wanted the read more link to be orange, but the rest of the text to be just gray. How do I fix it. I read the answer from https://theme.co/x/member/forums/topic/modifying-the-read-more-link/ but I wasn’t sure if it’s correct for what I’m looking for….

    #256891

    Prasant Rai
    Moderator

    Hello Shark,

    Thanks for writing in.

    Kindly go-ahead with the link you shared. Please let us know how it goes.

    Thanks.

    #256928

    Shark Bite
    Participant

    I added the code to function.php and it’s not working. Can we edit this line: . ( $enable_excerpt ? ‘<span class=”x-recent-posts-excerpt”>’ . strip_tags( get_the_excerpt() ) . ‘</span>’ : ” ) to include
    . get_permalink( get_the_ID() ) . ‘”>’ . __(‘Read More’, ‘your-text-domain’) ?

    Or edit the code from that link I shared to this:
    function new_excerpt_more( $more ) {
    return ‘ ‘ . __(‘Read More’, ‘your-text-domain’) . ‘‘;
    }
    add_filter( ‘excerpt_more’, ‘new_excerpt_more’ );

    #256929

    Shark Bite
    Participant
    function new_excerpt_more( $more ) {
    	return ' <a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('Read More', 'your-text-domain') . '</a>';
    }
    add_filter( 'excerpt_more', 'new_excerpt_more' );