Need help? Check out our Support site, then


How to customize css not to print links as urls?

  1. I am using The Truly Minimal theme. When I print a post, everything inside the tag is printed. How do I stop this? I think it is related to CSS. Where is the CSS and how can I change it? I bought Custom Design already. I also like to change the title font size, margin etc.

    Note: I first posted this to the general forum: http://en.forums.wordpress.com/topic/how-to-customize-css-not-to-print-links-as-urls?replies=5#post-1479716

    The blog I need help with is densytics.com.

  2. Hi,

    can you try this bit of code in your custom css panel:

    @media print {
    .entry-content a[href]:after, .entry a[href]:after{content:" (" attr(href) ")"; display: none !important;}}

    Go to your website and refresh your cache
    (ctrl+F5 in win, apple/cmd+R on mac)
    Let me know if this works,

    rgrds~

  3. @cristovaov. Thanks, but this did not work. I still see the links when I try to print.

  4. Hi there,
    did you copy-paste the code above?
    I've checked your custom css and it seems you are missing a ";" after the following bit .entry a[href]:after{content:" (" attr(href) ")"

    cheers~

  5. Great, thanks. I don't know how I missed that ";" but I copied and pasted the code again and now it is working.

    I also tried to add "font-size:12pt" but couldn't make it work. How can I play with font size, line height and margins, or title fonts etc.? I found this page http://codex.wordpress.org/Styling_for_Print but it is for WordPress.org. Is there a page like that for WordPress.com? Thanks, again.

  6. Make sure to include your CSS rules for print between the print query,
    An example for the font size and line heights of paragraphs with what we have added:

    @media print {
    .entry-content a[href]:after, .entry a[href]:after {
    content:" (" attr(href) ")"; display: none !important;
    }
    /*add your custom print rules under this comment.*/
    p {
    font-size:12pt;
    line-height:1.6em;
    }
    
    }

    I haven't seen a page like the one you are referring to for WP.com.
    It's a good reference point to observe the structure of a print style, though.

    Not wanting to disappoint but in honesty I think print styling is an advanced and specific topic: the understanding of CSS+HTML properties and their relationship is paramount and perhaps out of the scope of the "Custom Design" module offered on WP.com

    -greetz~

  7. @cristovaov, nice job on the CSS solution! Glad to have you around. :)

Topic Closed

This topic has been closed to new replies.

About this Topic