Viewing 12 replies - 1 through 12 (of 12 total)
  • Theme Author themevision

    (@themevision)

    Hello @bodtje!

    Try to Insert your formatted text into the “Excerpt” text field on the right side of your post (Edit post, then copy your text from the main area to the “Excerpt” text field on the right.).
    https://prnt.sc/pcz7l1
    https://prnt.sc/pcz90n

    Regards

    Thread Starter bodtje

    (@bodtje)

    Hi,

    Thank you very much for your quick answer but I don’t have an Excerpt text field on the right side.

    kind regards

    Theme Author themevision

    (@themevision)

    Hi,@bodtje!

    Yes, you must have it ??

    If you do not see it, just enable the settings dialog by clicking the settings button located in the very top right corner.

    https://prnt.sc/pd1lpc
    https://prnt.sc/pd1m6p

    Regards

    Thread Starter bodtje

    (@bodtje)

    Yes indeed,

    I found it and it works. Now just one little thing. The “Read more” (“Lees verder”) link is gone. How can I put it back in there?

    Thank you so much for your patience and helpful hints.

    ??
    Marc

    Theme Author themevision

    (@themevision)

    Hello, Marc!

    1.Install and activate “My Custom Functions” plugin.
    https://prnt.sc/pda4u3

    2.From your WordPress dashboard, navigate to Settings->PHP inserter, and place the following custom PHP code in the code editor field:

    function custom_excerpt($text) {  // custom 'read more' link
       if (strpos($text, '[...]')) {
          $excerpt = strip_tags(str_replace('[...]', '... <a href="'.get_permalink().'">Read More...</a>', $text), "<a>");
       } else {
          $excerpt = '<p>' . $text . '<a href="'.get_permalink().'">Read More...</a></p>';
       }
       return $excerpt;
    }
    add_filter('the_excerpt', 'custom_excerpt');

    3. Switch the toggle to the “ON” position.

    4. Click the “Save changes” button.

    https://prnt.sc/pda8s6

    5. Refresh your Blog Page…

    Now you should have the “Read More” link.
    https://prnt.sc/pdaasx

    Regards

    Thread Starter bodtje

    (@bodtje)

    Great!

    Thank you so much.
    is it possible to have the same lay out + “Lees verder” on the Blog summary page (https://www.ingridverhelst.be/blog/)? Because I don’t see the Excerpts text field (Samenvattingen) possibility in the Screen options…

    Once again thanks for your continuous support. You are so helpful.

    ??
    Marc

    Theme Author themevision

    (@themevision)

    Hi,@bodtje

    From what I see you have created a blog summary page using the “Gold Addons For Elementor” plugin.
    While this is a great plugin, it has some limitations as well.
    If you want to display formatted text, there is an option in the GA Blog widget to display “Full Content” instead of an excerpt.
    https://prnt.sc/pdb9eh
    In this case, your text remains formatted. (But unfortunately without the Read more … link)

    Regards

    Thanks, worked fine for me, I just want to add, that you have to switch off “Read More”-links in the customizer, otherwise it is doubled on posts without a manual exerpt.

    To have them styled as usual (in the agama style!), don’t forget to add the class to the html-element:

    function custom_excerpt($text) {  // custom 'read more' link
       if (strpos($text, '[...]')) {
          $excerpt = strip_tags(str_replace('[...]', '... <a class="more-link" href="'.get_permalink().'">Read More...</a>', $text), "<a>");
       } else {
          $excerpt = '<p>' . $text . '<a class="more-link" href="'.get_permalink().'">Read More...</a></p>';
       }
       return $excerpt;
    }
    add_filter('the_excerpt', 'custom_excerpt');
    • This reply was modified 5 years, 1 month ago by dorsch.
    Thread Starter bodtje

    (@bodtje)

    Hi dorsch,

    was there an error in your first post of the code? My website went into problems (but it’s fixed now) and send me a warning.

    Can I safely use this last one now?

    Cheers and thanks for the useful added tips.

    ??
    Marc

    Thread Starter bodtje

    (@bodtje)

    Can someone please confirm that the above codes are correct.
    HTML validators return errors and when I’m applying this to my site, it becomes inaccessible.

    Thanks.
    Cheers,
    Marc

    Theme Author themevision

    (@themevision)

    Hi @bodtje!
    On code added by @dorsch
    Part of the code is missing. So you get the error.

    This is the correct code:

    function custom_excerpt($text) {  // custom 'read more' link
       if (strpos($text, '[...]')) {
          $excerpt = strip_tags(str_replace('[...]', '... <a class="more-link" href="'.get_permalink().'">Read More...</a>', $text), "<a>");
       } else {
          $excerpt = '<p>' . $text . '<a class="more-link" href="'.get_permalink().'">Read More...</a></p>';
       }
       return $excerpt;
    }
    add_filter('the_excerpt', 'custom_excerpt');

    Please follow the next steps to fix the plugin error:

    = Q. What to do if this plugin crashed the website? =
    A. This plugin has a built-in function for checking the custom code for syntax errors, duplicate functions names, and etc. But the plugin is not perfect, so there are times when the entered custom code causes the error and white screen (WSOD). This is due to the fact that your custom code has a syntax error that this plugin could not detect. When this happens with you, please perform the following steps.

    1. Access your server via FTP or SFTP. If you aren’t sure how usually your web hosting provider will have instructions somewhere on their website.
    2. Browse to the directory wp-content/plugins/my-custom-functions/. Please contact your web hosting company to get help if you can’t find this folder.
    3. Rename the file START to STOP. This will stop the execution of your custom code.
    4. Log in to the Admin Area of your WordPress website.
    5. Go to the plugin settings page Settings -> PHP Inserter.
    6. Edit/fix your custom PHP code that you entered before the crash.
    7. Return to the plugin folder and rename the file STOP to START and you’re done!

    PS. As the @dorsch correctly mentioned, you have to switch off “Read More”-links in the customizer, otherwise it is doubled on posts without a manual excerpt. (Customizing ? Blog ? General)

    Regards

    • This reply was modified 5 years, 1 month ago by themevision.
    Thread Starter bodtje

    (@bodtje)

    Hi @themevision,

    this works like charm.
    And also thanks for the fix!

    Kind regards,
    Marc

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘Edit Blog Category Page’ is closed to new replies.