Puas Yog Koj WordPress Blog Tshuab Luam Ntawv-Phooj Ywg?

Sau CSS

Raws li kuv ua tiav nag hmo ncej ntawm Social Media ROI, Kuv xav tau xa cov saib ua ntej ntawm nws rau Dotster CEO Clint Page. Thaum kuv luam rau PDF, tab sis, nplooj ntawv yog qhov ua tsis meej!

Tseem tshuav ntau cov neeg tawm muaj uas nyiam luam tawm cov ntawv luam ntawm lub vev xaib kom sib qhia, siv tom qab, lossis tsuas yog sau nrog qee cov ntawv sau tseg. Kuv txiav txim siab Kuv xav ua kom kuv blog luam ntawv-nyiam. Nws yooj yim dua qhov kuv xav tias nws yuav yooj yim dua.

Yuav Qhia Koj Li Cas

Koj yuav tsum nkag siab txog cov hauv paus ntawm CSS kom ua tiav qhov no. Qhov nyuaj tshaj plaws yog siv koj tus browser qhov tsim tawm kom ntsuas kev teeb tsa, zais thiab kho cov ntsiab lus kom koj thiaj li sau koj lub CSS. Hauv Safari, koj yuav tsum tau pab kom cov cuab yeej tsim tawm, muaj cai nyem koj nplooj ntawv, thiab xaiv Cov Ntsiab Lus Tshawb Xyuas. Qhov ntawd yuav qhia koj lub ntsiab thiab CSS cuam tshuam.

Safari muaj qhov kev xaiv zoo me me los tso tawm cov qauv luam tawm ntawm koj nplooj ntawv hauv tus kws kuaj xyuas lub vev xaib:

Safari - Sau Saib Hauv Web Soj Ntsuam

Yuav ua li cas yuav ua rau koj WordPress Blog Luam Ntawv-Friendly:

Muaj ob peb txoj kev sib txawv ntawm kev qhia tseeb koj txoj kev xaiv rau luam. Ib qho tsuas yog ntxiv ib ntu hauv koj daim ntawv teev tam sim no uas tshwj xeeb rau hom xov xwm ntawm "luam tawm".

@media print {
     header, 
     nav, 
     aside { 
         display: none; 
     }
     #primary { 
         width: 100% !important 
     }
     .hidden-print, 
     .google-auto-placed, 
     .widget_eu_cookie_law_widget { 
         display: none; 
     }
}

Lwm txoj kev yog los ntxiv ib daim ntawv qhia tshwj xeeb rau koj tus menyuam cov ntsiab lus uas teev cov kev xaiv ua luam tawm. Ntawm no yog yuav ua li cas:

  1. Luam tawm ib daim ntawv ntxiv rau koj cov ntsiab lus hu ua luam.css.
  2. Ntxiv rau qhov siv rau cov stylesheet tshiab hauv koj functions.php ntawv. Koj yuav xav kom koj cov ntaub ntawv print.css yog thauj tom qab koj niam thiab txiv thiab menyuam cov ntawv sib tw kom nws cov qauv tau xoob kawg. Kuv tseem tso thawj ntawm 100 ntawm qhov kev thauj khoom no kom nws thauj khoom tom qab plugin Ntawm no yog qhov kuv siv zoo li:

function theme_enqueue_styles() {
    global $wp_version;
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
    wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css', array('parent-style') );
    wp_enqueue_style( 'child-style-print', get_stylesheet_directory_uri() . '/print.css', array(), $wp_version, 'print' );
}
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' , 100);

Tam sim no koj tuaj yeem hloov kho print.css ntawv thiab hloov kho tag nrho cov ntsiab lus uas koj xav tau zais lossis nthuav tawm txawv. Hauv kuv lub xaib, piv txwv li, kuv zais tag nrho cov kev taw qhia, headers, sidebars, thiab footers yog li tsuas yog cov ntsiab lus uas kuv xav tso tawm kom pom.

My luam.css file zoo li no. Daim ntawv ceeb toom tias kuv tseem ntxiv cov npoo, ib txoj kev tau lees paub los ntawm cov browsers niaj hnub:

header, 
nav, 
aside { 
    display: none; 
}
#primary { 
    width: 100% !important 
}
.hidden-print, 
.google-auto-placed, 
.widget_eu_cookie_law_widget { 
    display: none; 
}

Saib seb Daim Ntawv Pom Zoo Li Cas

Nov yog qhov uas kuv cov ntawv luam tawm zoo li cas yog luam tawm los ntawm Google Chrome:

WordPress Sau Saib

Advanced Sau Ntxaij

Nws yog ib qho tseem ceeb kom nco ntsoov tias tsis yog txhua lub browsers yog tsim kom sib npaug. Koj tuaj yeem xav sim txhua browser kom pom tias koj nplooj ntawv zoo li cas thoob lawv. Qee tus txawm txhawb qee cov nplooj ntawv hauv qib siab ntxiv los ntxiv cov ntsiab lus, teeb npoo thiab nplooj ntawv ntau thiab tsawg, nrog rau lub xov tooj ntawm lwm lub ntsiab. Smashing Magazine muaj heev cov ncauj lus kom ntxaws hauv cov ntawv luam tawm tshiab xaiv.

Ntawm no yog qee cov nplooj ntawv cov ntsiab lus uas kuv tau ntxiv los ntxiv cov tswv yim kev txwv hauv qab sab laug, ib kab ntawv ntawm nplooj ntawv nyob hauv qab sab xis, thiab daim ntawv qhia npe nyob rau sab laug sab saum toj ntawm txhua nplooj ntawv:

@page { 
    size: 5.5in 8.5in;
    margin: 0.5in; 
}
@page:right{ 
  @bottom-left {
    margin: 10pt 0 30pt 0;
    border-top: .25pt solid #666;
    content: "©  " attr(data-date) " DK New Media, LLC. All Rights Reserved.";
    font-size: 9pt;
    color: #333;
  }

  @bottom-right { 
    margin: 10pt 0 30pt 0;
    border-top: .25pt solid #666;
    content: counter(page);
    font-size: 9pt;
  }

  @top-right {
    content:  string(doctitle);
    margin: 30pt 0 10pt 0;
    font-size: 9pt;
    color: #333;
  }
}

2 Comments

  1. 1
  2. 2

Yuav ua li cas koj xav hais tias?

Qhov Web site no siv Akismet los txo cov kev pabcuam. Kawm li cas koj cov ntaub ntawv tawm tswv yim tiav.