Ingabe Iphrinta Yakho Ye-WordPress Blog-Inobungane?

Phrinta i-CSS

Njengoba ngiqedile okuthunyelwe izolo ku I-Social Media ROI, Bengifuna ukuthumela ukubuka kuqala kwayo ku-CEO we-Dotster uClint Page. Lapho ngiphrinta i-PDF, noma kunjalo, leli khasi lalinokuxakaniseka!

Kusenabantu abaningi laphaya abathanda ukuphrinta amakhophi ewebhusayithi ukuze babelane ngawo, babhekise emuva kwesikhathi, noma bavele bafake amanye amanothi. Nginqume ukuthi ngifuna ukwenza ibhulogi yami ibe nobungane ngephrinta. Bekulula kakhulu kunalokho ebengicabanga ukuthi kuzoba njalo.

Ungayibonisa Kanjani Inguqulo Yakho Yokuphrinta:

Uzodinga ukuqonda izisekelo ze-CSS ukufeza lokhu. Ingxenye enzima kakhulu ukusebenzisa ikhonsoli yonjiniyela wesiphequluli sakho ukuhlola ukubonisa, ukufihla nokulungisa okuqukethwe ukuze ukwazi ukubhala i-CSS yakho. KuSafari, uzodinga ukunika amandla amathuluzi wonjiniyela, chofoza ngakwesokudla ikhasi lakho, bese ukhetha Hlola okuqukethwe. Lokho kuzokukhombisa i-element ne-CSS ehambisanayo.

I-Safari inenketho encane enhle yokubonisa inguqulo ephrintiwe yekhasi lakho kumhloli wewebhu:

I-Safari - Phrinta Buka ku-Web Inspector

Ungayenza Kanjani Iphrinta Yakho Ye-WordPress Yobungani:

Kunezindlela ezimbalwa ezahlukahlukene zokucacisa isitayela sakho sokuphrinta. Okunye ukwengeza isigaba kushidi lakho lesitayela lamanje eliqondene nohlobo lwemidiya lwe- “phrinta”.

@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 ukwengeza ishidi lesitayela esithile kutimu yengane yakho ecacisa izinketho zokuphrinta. Nakhu ukuthi:

  1. Layisha ishidi lesitayela elengeziwe enkombeni yakho yetimu ebizwa ngokuthi phrinta.css.
  2. Faka ireferensi kushidi lezitayela elisha ku- imisebenzi.php ifayela. Uzofuna ukuqinisekisa ukuthi ifayela lakho le-print.css lilayishwe ngemuva kweshidi lesitayela sakho somzali nengane ukuze izitayela zilayishwe okokugcina. Ngiphinde ngabeka okusemqoka okungu-100 kulokhu kulayishwa ukuze kulayishwe ngemuva kwe-plugin Nakhu ukuthi ireferensi yami ibukeka kanjani:

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

Manje usungenza ngendlela oyifisayo ifayela le-printa.css futhi ushintshe zonke izinto ofuna ukuthi zifihlwe noma zikhonjiswe ngendlela ehlukile. Esizeni sami, ngokwesibonelo, ngifihla konke ukuzulazula, izihloko, izinsimbi eziseceleni, nonyaweni ukuze kuprintwe kuphela okuqukethwe engifisa ukukukhombisa.

My phrinta.css ifayela libukeka kanjena. Qaphela ukuthi ngingeze namamaki, indlela eyamukelwa iziphequluli zesimanje:

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

Indlela Ukubuka Okuphrinta Kubukeka Ngayo

Nakhu ukuthi ukubuka kwami ​​kokuphrinta kubukeka kanjani uma kuphrintiwe kusuka ku-Google Chrome:

Ukubukwa Kwe-WordPress Phrinta

Ukuphrinta Okuthuthukile Okuthuthukile

Kubalulekile ukuthi wazi ukuthi akuzona zonke iziphequluli ezenziwe ngokulingana. Ungahle uthande ukuhlola isiphequluli ngasinye ukubona ukuthi ikhasi lakho libukeka kanjani kuzo. Abanye baze basekele ezinye izici ezithuthukisiwe zamakhasi ukwengeza okuqukethwe, ukusetha amamajini nosayizi bekhasi, kanye nezinye izinto eziningi. ISmashing Magazine inakho kakhulu indatshana enemininingwane ngalokhu kuphrinta okuthuthukile izinketho.

Nayi eminye imininingwane yokuhlelwa kwamakhasi engikufakile ukwengeza ukubalulwa kwelungelo lobunikazi ezansi kwesobunxele, ikhawunta yekhasi ngezansi kwesokudla, nesihloko sedokhumenti ngakwesokunxele phezulu ekhasini 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 Amazwana

  1. 1
  2. 2

UCABANGANI?

Le sayithi isebenzisa i-Akismet ukunciphisa ugaxekile. Funda ukuthi idatha yakho yokuphawula isetshenziswa kanjani.