• Resolved WebGremlin

    (@webgremlin)


    Hi,

    Currently, the “continue reading” button shows for every post, even if there is nothing more to read. I know I can hide the buttons using CSS, but that hides the buttons permanently. I’d like the button to show only if I’ve used the “read-more-tag”* functionality of the WYSIWYG editor. I.e. only show the button if it’s relevant. Is this something that can be done?

    *Not sure if I’m using the right translation, as I do not use the English version of WP. The function I’m referring to here is bound to shift-alt-T.

    Many thanks,

    WebGremlin

Viewing 1 replies (of 1 total)
  • Thread Starter WebGremlin

    (@webgremlin)

    Alright, I found a solution myself. At first, I thought I’d compromise and get rid of the ‘read more’ completely, and always have full blog posts shown by increasing the excerpt length in the theme settings. Then I noticed that the theme gets rid of all line breaks and text markup (e.g. hyperlink colour) in the excerpts which show on blog page. So here’s what I did instead:

    I copied this file to my child theme:
    maxwell/template-parts/content.php

    In there, I searched for
    <?php the_excerpt(); ?>
    and replaced it with:
    <?php the_content(); ?>

    Additionally, I deleted the line below the one I just replaced:
    <?php maxwell_more_link(); ?>

    And finally, I deleted the following from my style.css (which I had added previously to hide the original “continue reading” button).
    .more-link { display: none; }

    The latter was needed because WP’s Read More and Maxwell’s Read More button uses the same class identifier. Hence why I deleted the maxwell_more_link from content.php instead.

    Now full blog posts show on the blog page, and I can use the “read-more-tag” functionality of WP’s WYSIWYG editor to show a “read more” button in case I want one.

    • This reply was modified 7 years, 3 months ago by WebGremlin.
    • This reply was modified 7 years, 3 months ago by WebGremlin.
    • This reply was modified 7 years, 3 months ago by WebGremlin.
    • This reply was modified 7 years, 3 months ago by WebGremlin.
    • This reply was modified 7 years, 3 months ago by WebGremlin.
    • This reply was modified 7 years, 3 months ago by WebGremlin.
Viewing 1 replies (of 1 total)
  • The topic ‘“Continue reading” only when relevant?’ is closed to new replies.