Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1081233
    glenngtr
    Participant

    Hi there,

    I have searched the forum quite intensively but couldn’t find a straight answer to my question. I’d like to have two news posts on the front page in two rows with an excerpt of two lines underneath. Could you help me in providing the code for this. Right now I got stuck with the following code:

    [recent_posts count="2" no_image="true" enable_excerpt="true"]

    Thanks in advance!

    #1081258
    Darshana
    Moderator

    Hi there,

    Thanks for writing in! By default, our recent post shortcode do not support for excerpts. Because this requires a template change, I’d advise that you setup a child theme. This allows you to make code changes that won’t be overwritten when an X update is released. After your child theme is setup, please review how we recommend making template changes in Customization Best Practices.

    Once you setup your child theme and activate it, please follow this instructions (https://community.theme.co/forums/topic/show-excerpt-in-recent-posts-element-other-questions/#post-989700).

    Hope that helps.

    #1086636
    glenngtr
    Participant

    Thanks for the advice. I had already set up a child theme and customized the functions.php file. I have updated it with the code from you suggested link. However I’d like the news messages to show underneath each other instead of next to each other. Is there a shortcode to fix this? And still I am not seeing the excerpt.

    Thank you.

    #1086766
    Darshana
    Moderator

    Hi 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
    – FTP credentials

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

    #1087163
    glenngtr
    Participant
    This reply has been marked as private.
    #1087960
    Rad
    Moderator

    Hi there,

    Thanks, It’s working, I can see the excerpt. And please change this part of code

    function custom_recent_posts() {
      remove_shortcode( 'x_recent_posts' );
    
      add_shortcode( 'x_recent_posts', 'x_shortcode_recent_posts_v2' );
    }

    to this,

    function custom_recent_posts() {
      remove_shortcode( 'x_recent_posts' );
      remove_shortcode( 'recent_posts' );
      add_shortcode( 'recent_posts', 'x_shortcode_recent_posts_v2' );
      add_shortcode( 'x_recent_posts', 'x_shortcode_recent_posts_v2' );
    }

    This post doesn’t have any excerpt http://veiligheid.plus/cornerstone-draft/ because it’s composed within cornerstone. With that, you should set your excerpt manually. Edit that post and click Screen options on the very top, then enable Excerpt. Then scroll that until you find the excerpt section and manually add you excerpt.

    And make sure to add orientation as vertical to make each post in row. Eg. [recent_posts ...... orientation="vertical"]

    Thanks!

    Thanks!

  • <script> jQuery(function($){ $("#no-reply-1081233 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>