Okay
  Public Ticket #1397315
How to insert a read more link on Excerpt
Closed

Comments

  •  4
    Hugo8888 started the conversation

    Hello
    There is a question when I editing a post page need to ask.
    How to insert a read more link at the end of Excerpt?
    Please see my attachment to get the best understanding what I mean.

    Cheers
    Hugo

  •  1,560
    Laborator replied

    Hi Hugo,

    I see you have an older ticket assigned to Eroll, and it appears that he helped you, is that not helping anymore?

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •  4
    Hugo8888 replied

    Hello Art
    Yes, Eroll just helps me to modify and edit the theme code about '' read more.''
    The difficulty is I do not know how to make it display on my post page's Excerpt?
    I want to add '' read more.'' to the Excerpt and insert a link so that visitor clicks it then will display a full post page.
    The Kalium theme seems can't insert a link to the Excerpt.
    Hope you can teach me how to do that?

    Best Regards
    Hugo

  •  1,560
    Laborator replied

    Hi Hugo,

    As I see it is the same thing, but anyway I'll need to login into your site as I cannot because I am being redirected to a 404 page, please add the credentials or method of logging into your site again.

    Best regards,
    Laborator Team


      Documentation         Join Kalium Users Group

  •   Hugo8888 replied privately
  • [deleted] replied

    Hi Hugo,

    I have corrected the previous code in functions.php you have added to this version"

    // Read more link
    function new_excerpt_more( $more ) {
    echo '<a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('Read More', 'kalium') . '</a>';
    }
    add_action( 'kalium_blog_loop_post_details', 'new_excerpt_more', 21 );

    And now read more link appears on your site:


    (view large version)

    To give it a little styling you can add CSS with this selector:

    .post-details .read-more {
        font-size: 14px;
        margin-bottom: 20px;
    }

  •  4
    Hugo8888 replied

    Hello Arlind
    Thanks for helping me.
    I don't understand the code. Your Screenshot is what I want to create for my site. 
    Would you please give me more details how to create that from the first step to the last step. I need a step by step guild.

    Best Regards
    Hugo

  • [deleted] replied

    Hi Hugo,

    Sure, here are the steps I have followed to add the excerpt in your blog posts:

    1. Go to Appearance > Editor and click functions.php file to edit

    2. Copy the following code (it is already applied on your site for the moment) and paste in the end of functions.php then save the file:

    // Read more link
    function new_excerpt_more( $more ) {
        echo '<a class="read-more" href="'. get_permalink( get_the_ID() ) . '">' . __('Read More', 'kalium') . '</a>';
    }
    add_action( 'kalium_blog_loop_post_details', 'new_excerpt_more', 21 );
    
    3. Go to Custom CSS and in the end of editor add this CSS:

    /* Read more excerpt styling */
    .post-details .read-more {
        font-size: 15px;
        margin-bottom: 20px;
    }
    .blog-posts .post-item .post-details .post-excerpt {
        margin-bottom: 10px;
    }
    
    And click Save changes. The results are:


    (view large version)

  •  4
    Hugo8888 replied

    Hello Arlind
    Thanks for your help!
    The code that you edit for site seems lost after my blog update to Kalium  Theme 2.1.6
    I check my site to see that "Read More" is disappeared.
    How to prevent this happen again in the next Update?
    Please see my attachment I trying to edit functions .php file was failed.
    I really don't know which functions .php file should be edited?
    Also, Please tell me the Custom CSS that I edited is correct or wrong?
    To get the best understanding, I need a Screenshot of each step.

    Best Regards
    Hugo

  •  4
    Hugo8888 replied

     2 photos

  • [deleted] replied

    Hi there,

    My team mate (Arlind) can help you with this question, but he is not in the office until 02 January.

    When Arlind come back, just reply to this thread and you will make sure he will see your comment.

    Thanks for your understanding!

  •  4
    Hugo8888 replied

    Hello 
    It's a long time for me to wait until 02 January.
    Is Arlind the only one can solve this question for me?

    Best Regards
    Hugo

  • [deleted] replied

    Hi Hugo,

    Sorry but only Arlind can help you on this. This is a customization question and support doesn't offer customization services as we wrote on our support homepage. But when Arlind comes back you can ask him again if he can help you again for this question.

    If you're looking for professional help in this matter, there's always someone available for such tasks on the WP Kraken or Envato Studio. Pricing and timeline are always straightforward there and that's the main reason for recommending those services.

    Thanks for your understanding.