Mar
18

Category specific css to achieve a print “cover page” css look

WordPress  
Off

For a school’s online newsletter we wanted the “photo of the week” category to present differently from other posts. Ideally we wanted special styling in the print css. However since printing of background images and colour is optional, we wanted to be sure that the users knew that the styling was there and that they should set their browser page setup to also print the background images.

This required the following:

  • using the sandbox theme’s functions (we may move the whole site to a sandbox theme, but for now we are making minimal changes)
  • replacing a line of code with the sandbox equivalent to achieve the styling in each of the following:
    • single.php and
    • index.php
  • creating the necessary css to achieve a header and a footer. We used background images on the div class category for the header and on a bottom background image on the entry text within that category class.  Hmm had to change that due to problems with users having to remember to request the print of background image and this is not always obvious (try IE6! for example).  So… we now check for the category in the template file and add in the necessary header and footer images so they appear both in the online and print versions.
  • creating special classes for images to that artwork would extend beyond the borders out to the margins. The newsletter always needs a wide margin for readability.

Related posts:

  1. Breadcrumbs The AmR WordPress Breadcrumb navigation widget plugin is available here. Features: Uses listed items with minimal markup. The markup is...
  2. Widgetized headers and footers? Dynamic (widgetized) Sidebars are great, but would you not like to have a dynamic header and footer in your theme...
  3. Submenu, Page, slug, attached media confusion I had a really odd one today.  A client had added text to a submenu page that was either empty...
  4. CSS for real html tables There are occasions when an HTML table is appropriate. One then wants the data to be presented well. Following are...
  5. Initial content for a new page or post – wordpress pleasant surprise How to create a link to the add new page or post with default starting content...
Categories : WordPress

WP Questions

Preferred Web Host

Web hosting by ICDSoft Icdsoft - Why? They are good and reasonable, used them since 2001. Read more