Rss

About Me

My photo
SURAKARTA, JAWA TENGAH, Indonesia
Pernah bersekolah di SDN Begalon 2 Surakarta berlanjut ke SMP N 2 Grogol, Skh. Lalu ketika semester 3 pindah ke Banjarnegara, bersekolah si SMP N 2 Banjarnegara dikarenakan perintah orang tua. Dan saat semester ke 4 pindah lagi ke Solo dan bersekolah di SMP N 25 Surakarta. Sekitar tahun 2004/2005 lanjut ke SMK TP 2 Surakarta dan lulus pada tahun 2008. Mulai berkuliah di POLITEKNIK INDONUSA SURAKARTA pada tahun 2010. Minat saya hanya ingin bekerja dengan imajinasi saya, bukan dengan tenaga maupun berfikir hitung-hitungan yang ribet, hehe.. Saya ingin menjadi seorang desainer dan musisi.. :-D

Monday, May 21, 2012

Creating a Custom Header

Let us move on to more advanced tricks again. This time we will add a facility to replace the image on the header. With this facility, users can define their own theme we want to use any image. Cool is not it?We can also determine the width and height of the header to fit the themes. Amazingly, it turns out the trick that we have themes custom header facility is very easy you know ..hehehe ... How the hell do I? Cekidot gan!There are two files that we are brain-tweaking here is functions.php and index.php file. At functions.php we add this code at the bottom:
define ('HEADER_IMAGE_WIDTH', 900);define ('HEADER_IMAGE_HEIGHT', 120);define ('HEADER_TEXTCOLOR', '000000 ');
  
add_custom_image_header ('', 'themegue_header_style');
  
themegue_header_style function () {echo '<style type="text/css"># Headimg {
  
height: 120px;
  
background: # cccccc;}# Name {
  
font-family: Georgia, "Bitstream Charter", serif;
  
font-size: 30px;}h1 a {
  
text-decoration: none;
  
}# Desc {
  
font-family: Georgia, "Bitstream Charter", serif;
  
font-size: 14px;}
 
</ Style> ';}
There are three sections in the above code. The first is define code that contains the values ​​of the default blog header later.define ('HEADER_IMAGE_WIDTH', 900);: determining the size of the width of the headerdefine ('HEADER_IMAGE_HEIGHT', 120);: determining the size of the header heightdefine ('HEADER_TEXTCOLOR', '000000 ');: determines the color of text in the headerThen followed by the code to the declaration that we provide changing facilities theme header.add_custom_image_header ('', 'themegue_header_style');And last is the code we use to put style on admin pages later when user edit the image header.Once the codes are entered in the functions.php we specify the location of the header in index.php (remember, WP just robots who do not know anything if we ndak you know)Because we design theme is the background image we put style before the tag </ head>


 
<style type="text/css">
  
# Header {
    
background: url (<? php header_image ();?>);
  
}
  
. Blogtitle a,. Description {
    
color: <? php header_textcolor ();?>
  
}
 
</ Style>
You look at the code <? Php header_image ();?> Is the code to call the header images posted by the user.Now please deh try to get into wp-admin and click the Appearance menu - Header

0 comments:

Post a Comment

Coment here