• I am working on a print stylesheet that is using this CSS feature to add the URL after the links, within the post content.

    .postContent a:link:after,
    .postContent a:visited:after {
      content: " (" attr(href) ") ";
      font-size: 10pt;
    }

    However, it also adds the URL to the “read more” link, which I don’t want.
    I have tried using the WordPress default class “more-link” that is part of the “read more” link,

    .postContent a:link:after.more-link,
    .postContent a:visited:after.more-link { content: ""; }

    but this had no effect.

    I also tried adding a class to a span within the tag in index.php

    <?php the_content('<span class="note">Read more &raquo;</span>'); ?>

    but this didn’t effect it either, because the span ends up inside the opening and closing link tags so it doesn’t affect the link but the text inside it.

    I think I need to do this as a function in my theme, but I don’t know in which file is the default code that creates the “read more” …

    any help? thank you…

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

    (@moodles)

    I figured it out… css syntax error.

    The class to a pseudo-class is added to the element, not the pseudo-class.

    This is what worked:

    .postContent a.more-link:link:after,
    .postContent a.more-link:visited:after { content: ""; }
Viewing 1 replies (of 1 total)
  • The topic ‘add a class to the “read more” ?? – RESOLVED’ is closed to new replies.