Ngaba iprinta yakho yeblogPress-Friendly?

Shicilela i-CSS

Njengokuba ndigqibezele iposti yayizolo Imidiya yokuncokola ROI, Ndifuna ukuthumela umbono wayo kwi-Dotster CEO uClint Page. Xa ndashicilela kwiPDF, nangona kunjalo, iphepha lalinengxaki!

Kusekho abantu abaninzi phaya abathanda ukuprinta iikopi zewebhusayithi ukuze babelane, babhekise kamva, okanye bafayilishe amanqaku. Ndithathe isigqibo sokuba ndifuna ukwenza ibhlog yam ukuba ibe yeprinta. Kwakulula kakhulu kunokuba ndandicinga ukuba kuya kuba njalo.

Uyibonisa njani inguqulelo yakho yokuPrinta:

Kuya kufuneka uqonde iziseko zeCSS ukufezekisa oku. Elona candelo linzima kukusebenzisa ikhonsoli yonjiniyela wakho ukuvavanya ukubonisa, ukufihla, kunye nokulungelelanisa umxholo ukuze ubhale iCSS yakho. Kwi-Safari, kuya kufuneka usebenze izixhobo zokuphucula, cofa ekunene kwiphepha lakho, kwaye ukhethe Jonga umxholo. Oko kuyakubonisa into kunye neCSS ehambelana nayo.

I-Safari inokukhetha okuhle ukubonisa iphepha lokuprinta kwiphepha lakho kumhloli wewebhu:

Safari-Jonga ukuPrinta kuMhloli weWebhu

Uyenza njani iPrinta yakho yeWordPress yeBlog ye-Friendly:

Kukho iindlela ezahlukeneyo zokuchaza isitayile sakho sokuprinta. Inye kukudibanisa icandelo kuhlobo lwangoku lweetayitile ezithile kuhlobo losasazo "lokuprinta".

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

Enye indlela yokongeza iphepha elithile lomxholo kumxholo womntwana wakho ocacisa ukhetho lokuprinta. Nantsi indlela:

  1. Ngenisa isheethe elongezelelekileyo kwincwadi yakho yemixholo ebizwa ngokuba Shicilela.
  2. Yongeza ireferensi kwiphepha elitsha lesitayile kwifayile yakho Imisebenzi.php ifayile. Uya kufuna ukuqinisekisa ukuba ifayile yeprinta.css ilayishwe emva komzali kunye noshicilelo lwesitayile somntwana ukuze izitayile zilayishwe okokugqibela. Ndabeka into ephambili kwi-100 kolu layisho ukuze ilayishe emva kweplagi Nantsi indlela ekubonakala ngayo ireferensi yam:

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);

Ngoku unokwenza ifayile yeprinta.css kwaye uguqule zonke izinto ofuna ukuzifihla okanye ziboniswe ngokwahlukileyo. Kwindawo yam, umzekelo, ndifihla konke ukukhangela, iintloko, iibar ezisecaleni, kunye neenyawo ukuze kuphela umxholo endinqwenela ukuwubonisa uprintiwe.

My Shicilela ifayile ijongeka ngoluhlobo. Qaphela ukuba ndongeze imida, indlela eyamkelweyo kwizikhangeli zangoku:

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

Indlela ejongwa ngayo iPrinta

Nantsi indlela endijonga ngayo ukujonga ukuprinta kuGoogle Chrome:

UkuPrinta kweWindowsPress

UkuPrinta okuPhucukileyo okuPhambili

Kubalulekile ukuba uqaphele ukuba ayizizo zonke izikhangeli ezenziweyo ezilinganayo. Unokufuna ukuvavanya isikhangeli ngasinye ukubona ukuba iphepha lakho lijongeka njani kubo. Abanye bade baxhase ezinye izinto zekhasi eliphambili ukongeza umxholo, ukuseta imida kunye nobukhulu bephepha, kunye nenani lezinye izinto. Iphephancwadi leSmashing linalo kakhulu Inqaku elineenkcukacha kolu shicilelo luphambili ukhetho.

Nazi ezinye iinkcukacha zobeko lwephepha endizibandakanyileyo ukongeza ukukhankanywa kwelungelo lokushicilela emazantsi ngasekhohlo, iphepha elimele iphepha ngasekunene, kunye nesihloko soxwebhu phezulu ngasekhohlo kwiphepha ngalinye:

@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

Ingaba ucinga ntoni?

Le sayithi isebenzisa i-Akismet ukunciphisa ugaxekile. Funda indlela idatha yakho yokubhaliweyo isetyenziswe ngayo.