Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1141149
    bartvanoers
    Participant

    Hey guys, I’d like to show a read more button underneath the recent posts in the recent posts shortcode. I already managed to show the exerpt. I found a few posts regarding this issue, but I couldn’t find a solution.

    You can view the site here.

    I’d like something like in the attached image.

    Can this be done?

    Thanks!

    #1141157
    Christian
    Moderator

    Hey there,

    Regretfully this isn’t a feature offered by X. It could be possible with custom development, but this would be outside the scope of support we can offer. You might want to contact our trusted partners who caters X setup and customization needs. Please see https://community.theme.co/custom-development/.

    Here’s a quick tip though, check out the file plugins\cornerstone\includes\shortcodes\recent-posts.php and uncomment the commented lines to enable the excerpt which includes the read more link. Please take note that it is a feature that we do not support yet so any issue arising from the use of it is outside the scope of our support.

    Thanks for understanding. Take care!

    #1141205
    bartvanoers
    Participant

    Thanks for the quick reply!

    #1141235
    Thai
    Moderator

    If you need anything else please let us know.

    #1141255
    bartvanoers
    Participant

    I’m almost there with my “awesome” PHP skills 🙂

    Added this to the recent-posts.php:

    $output .= '<a class="x-recent-post' . $count . ' ' . $image_output_class . '" href="' . get_permalink( get_the_ID() ) . '" title="' . esc_attr( sprintf( __( 'Permalink to: "%s"', 'cornerstone' ), the_title_attribute( 'echo=0' ) ) ) . '">'
                     . '<article id="post-' . get_the_ID() . '" class="' . implode( ' ', get_post_class() ) . '">'
                       . '<div class="entry-wrap">'
                         . $image_output
                         . '<div class="x-recent-posts-content">'
                           . '<h3 class="h-recent-posts">' . get_the_title() . '</h3>'
                           . '<span class="x-recent-posts-date">' . get_the_date() . '</span>'
                           ////////////////////////////////////////
                           . $excerpt
                           /////////////////////////////////////////
                         . '</div>'
                         . '<p>[x_button shape="square" size="large" float="none" info="none" info_place="top" info_trigger="hover" class="btn-aqua" href="' . get_permalink( get_the_ID() ) . '""]Read more[/x_button]</p>'
                       . '</div>'
                     . '</article>'
                   . '</a>';

    but now the posts show one per row, not 3 as before (working locally, so see img). Could you maybe help me with that?

    #1141257
    bartvanoers
    Participant

    Also, when Cornerstone gets an update, will I lose the changes? How can I prevent that?

    #1141259
    Christian
    Moderator

    We’re sorry but we could not support any issues arising from this custom development. You might want to contact our trusted partners who caters X setup and customization needs. Please see https://community.theme.co/custom-development/

    Yes, your modifications will be lost if you’re modifying plugin files. To prevent that, you will need to override the function in your functions.php. That however would fall outside the scope of our support. Either way isn’t advisable though as update changes might break your site. The best way is to create your own custom element. See https://community.theme.co/kb/cornerstone-custom-elements/

    Thanks.

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