Special Offer - Get $90 Discount and Host Your Dream Web Site @ Dreamhost for 1 Year Click Here. Promo Code SLJ345
Back To Top
WordPress Web Application Development
Develop Powerfull Web Applications Using Cutting Edge WordPress Development Techniques

Simple Blog Header Designs Using WordPress Shortcodes – Box Headers

on 2011/10/19 4:45 AM stored in: Uncategorized and tagged:

Introduction To Box Header Design Templates

In this tutorial I am going to show you how to create box type blog headers as part of “Simple Blog Header Designs Using WordPress Shortcodes” post series. In this example the headers are surrounded with a box with background color and a border.

Creating Simple Box Headers

Inserting Shortcodes to functions.php file

function generate_header_css($content) {

        return "
"; } function box_head_medium($atts,$content) { $style = box_head_styles($atts); return "

" . do_shortcode($content) . "

"; } function box_head_large($atts,$content) { $style = box_head_styles($atts); return "

" . do_shortcode($content) . "

"; } function box_head_styles($atts) { $color = isset ($atts['color']) ? "color:".$atts['color'].";" : ''; $background = isset ($atts['color']) ? "background-color:".$atts['background'].";" : ''; $outline = isset ($atts['color']) ? "outline-color:".$atts['outline'].";" : ''; $style['part1'] = $background.$outline; $style['part2'] = $color; return $style; }

Syntax of Box Headers
There are 3 types of predefined box headers. You can use box_head_small,box_head_medium or box_head_large in the type attribute to check these 3 different box headers. Your main shortcode will be [[header]Your Title [/header]]. I have used box_head_small in the example given below.

[[header type='box_head_small' color='#fff' background='#809FC5' outline='#162F4D'] Your Title [/header]]

Parameters of Box Headers

Main Shortcode
[[header /]] is the main shortcode you need to be using.
Main Parameters
type defines the type of list. for feature boxes this should have the value box_head_small, box_head_medium or box_head_large
Optional Parameters
outline Border color of the box header. Default value = #CFCFCF
background Background color of the box header. Default value = #EEEEEE
color Text color of box header. Default value =#000


Examples of Using Box Headers

Creating Box Headers Default Version

[[header type='box_head_small' ] Sample Blog Post Title [/header]]

  [[header type='box_head_medium'] Sample Blog Post Title [/header]]
  [[header type='box_head_large']Sample Blog Post Title [/header]]
 

[header type=’box_head_small’ ] Sample Blog Post Title [/header] [header type=’box_head_medium’] Sample Blog Post Title [/header] [header type=’box_head_large’]Sample Blog Post Title [/header]

Creating Custom Styled Box Headers
[[header type='box_head_small' background='#BFD2F4' color='#2B4278' outline='#7FA0DC'] Sample Blog Post Title [/header]]

[header type=’box_head_small’ background=’#BFD2F4′ color=’#2B4278′ outline=’#7FA0DC’] Sample Blog Post Title [/header]

[[header type='box_head_medium' background='#BFD2F4' color='#2B4278' outline='#7FA0DC'] Sample Blog Post Title [/header]]

[header type=’box_head_medium’ background=’#BFD2F4′ color=’#2B4278′ outline=’#7FA0DC’] Sample Blog Post Title [/header]

[[header type='box_head_medium' background='#000' color='#fff' ] Sample Blog Post Title [/header]]

[header type=’box_head_medium’ background=’#000′ color=’#fff’ ] Sample Blog Post Title [/header]

[[header type='box_head_large' background='#635E65' color='#ACAEB7' outline='#7FA0DC'] Sample Blog Post Title [/header]]

[header type=’box_head_large’ background=’#635E65′ color=’#ACAEB7′ outline=’#7FA0DC’] Sample Blog Post Title [/header]

One Response to “Simple Blog Header Designs Using WordPress Shortcodes – Box Headers”

  1. water ionizer Says:

    I like this idea. I visited your website for the first time and simply been your fan. Continue to keep writing as I am planning to come to read it daily!!

Leave a Reply

Follow Us On Facebook