-->

Cara Membuat/Mengganti Header Blog Menjadi 2 Kolom Responsive

Cara Membuat/Mengganti Header Blog Menjadi 2 Kolom Responsive

Salam Blogger, Kali ini CREPICTDGZ mau berbagi tips Bagaimana Cara Membuat atau Mengganti Header Blog Menjadi 2 Kolom dan tentunya Responsive. Mengganti yang dimaksud disini adalah HEADER BLOG yang sebelumnya hanya terdiri 1 kolom yaitu Judul dan Diskripsi blog saja, Nah… disini kita akan menggantinya menjadi 2 kolom yaitu KIRI yang terdiri Judul dan Header Blog dan KANAN umumnya sebagai kolom IKLAN atau ADSENSE.

Cara Membuat/Mengganti Header Blog Menjadi 2 Kolom Responsive

Pada Tahap awal Sobat harus mencari kode CSS dan HTML yang terkait dengan HEADER BLOG yang ingin Sobat ganti pada Template sebelumnya…..lalu menghapusnya.
DISINI yang WAJIB Sobat Newbie lakukan adalah BACKUP TEMPLATE sebelum melakukan oprek kode CSS dan HTML dalam hal ini sambil belajar koding Newbie butuh ketelitian dan kehati-hatian  

Cara Membuat/Mengganti Header Blog Menjadi 2 Kolom Responsive

Langkah 1

Cari kode CSS yang berkaitan dengan HEADER BLOG umumnya kode CSS seperti berikut ( #header atau .header dan pada body#layout #header dst) termasuk kode CSS yang ada pada Media Query dan jika sudah ketemu HAPUS semuanya….!

Langkah 2

Cari kode seperti dibawah ini atau mirip ( kode HTML Header Blog ini panjang )

<div id='header-wrapper' itemscope='itemscope' itemtype='http://schema.org/WPHeader'>
...........
...........
...........
</b:section>
</div>

Jika sudah ketemu silahkan dihapus semuanya dan GANTI dengan kode yang ada dibawah ini.

<div id='header-wrapper' itemscope='itemscope' itemtype='http://schema.org/WPHeader'>
  <b:section class='header section' id='header' maxwidgets='1' showaddelement='no'>
    <b:widget id='Header1' locked='true' title='CREPICTDGZ (Header)' type='Header' version='1'>
      <b:widget-settings>
        <b:widget-setting name='displayUrl'/>
        <b:widget-setting name='displayHeight'>0</b:widget-setting>
        <b:widget-setting name='sectionWidth'>-1</b:widget-setting>
        <b:widget-setting name='useImage'>false</b:widget-setting>
        <b:widget-setting name='shrinkToFit'>false</b:widget-setting>
        <b:widget-setting name='imagePlacement'>BEHIND</b:widget-setting>
        <b:widget-setting name='displayWidth'>0</b:widget-setting>
      </b:widget-settings>
      <b:includable id='main'>
  <b:if cond='data:useImage'>
    <b:if cond='data:imagePlacement == &quot;BEHIND&quot;'>
      <!--
      Show image as background to text. You can't really calculate the width
      reliably in JS because margins are not taken into account by any of
      clientWidth, offsetWidth or scrollWidth, so we don't force a minimum
      width if the user is using shrink to fit.
      This results in a margin-width's worth of pixels being cropped. If the
      user is not using shrink to fit then we expand the header.
      -->
      <b:if cond='data:mobile'>
          <div id='header-inner'>
            <div class='titlewrapper' style='background: transparent'>
                <b:include name='title'/>
            </div>
            <b:include name='description'/>
          </div>
        <b:else/>
          <div expr:style='&quot;background-image: url(\&quot;&quot; + data:sourceUrl + &quot;\&quot;); &quot;                        + &quot;background-position: &quot;                        + data:backgroundPositionStyleStr + &quot;; &quot;                        + data:widthStyleStr                        + &quot;min-height: &quot; + data:height                        + &quot;_height: &quot; + data:height                        + &quot;background-repeat: no-repeat; &quot;' id='header-inner'>
            <div class='titlewrapper' style='background: transparent'>
                <b:include name='title'/>
            </div>
            <b:include name='description'/>
          </div>
        </b:if>
    <b:else/>
      <!--Show the image only-->
      <div id='header-inner'>
        <a expr:href='data:blog.homepageUrl' style='display: block'>
          <img expr:alt='data:title' expr:height='data:height' expr:id='data:widget.instanceId + &quot;_headerimg&quot;' expr:src='data:sourceUrl' expr:width='data:width' style='display: block'/>
        </a>
        <!--Show the description-->
        <b:if cond='data:imagePlacement == &quot;BEFORE_DESCRIPTION&quot;'>
          <b:include name='description'/>
        </b:if>
      </div>
    </b:if>
  <b:else/>
    <!--No header image -->
    <div id='header-inner'>
      <div class='titlewrapper'>
          <b:include name='title'/>
      </div>
      <b:include name='description'/>
    </div>
  </b:if>
</b:includable>
      <b:includable id='description'>
  <div class='descriptionwrapper'>
    <p class='description'><span><data:description/></span></p>
  </div>
</b:includable>
      <b:includable id='title'>
  <b:if cond='data:blog.pageType != &quot;item&quot;'>
    <b:if cond='data:blog.pageType != &quot;static_page&quot;'>
      <h1 class='title'>
        <a expr:href='data:blog.homepageUrl' expr:title='data:blog.title' itemprop='url'>
          <span itemprop='name'><data:title/></span>
        </a>
      </h1>
      <b:else/>
      <h2 class='title'>
        <a expr:href='data:blog.homepageUrl' expr:title='data:blog.title' itemprop='url'>
          <span itemprop='name'><data:title/></span>
        </a>
      </h2>
    </b:if>
    <b:else/>
    <h2 class='title'>
      <a expr:href='data:blog.homepageUrl' expr:title='data:blog.title' itemprop='url'>
        <span itemprop='name'><data:title/></span>
      </a>
    </h2>
      </b:if>
</b:includable>
    </b:widget>
  </b:section>
  <b:section class='header-right section' id='header-right' maxwidgets='1' showaddelement='yes'/>
</div>
<div class='clear'/>

Langkah 3

Kita mengganti semua kode CSS yang sudah kita hapus pada Langkah 1 sebelumnya :

1. Letakkan kode dibawah ini sebelum kode ]]></b:skin>

#header-wrapper {margin:20px;overflow:hidden;}
#header {float:left;width:100%;max-width:430px;}
.header-right {float:right;padding:0;overflow:hidden;margin:0;width:100%;
max-width:468px;}

2. Letakkan kode dibawah ini dibawah kode <b:template-skin>

body#layout #header-wrapper {min-height:0px;width:100%;}
body#layout #header {width:30%;}
body#layout #header-right {width:70%;}
#layout #header-wrapper{min-height:0px;width:100%;margin:10px 0 0 0;}

3. Kemudian letakkan kode dibawah diatas kode</head>

/* CSS Header Wrapper */
#header-wrapper {margin:30px auto;padding:0;overflow:hidden;max-width:920px;overflow:hidden;}
#header {float:left;width:100%;max-width:430px;color:#333;margin:0;}
#header h1, #header h2, #header p {font-family:Roboto;font-size:240%;font-weight:700;color:#333;text-transform:uppercase;}
#header a {color:#333;text-decoration:none;transition:all 0.3s ease-out;}
#header a:hover {color:#398dcc;}
#header .description {font-family:Roboto;font-size:100%;font-weight:400;color:#666;text-transform:none;line-height:normal;margin:0;}
.header img {display:block;}
.header-right {float:right;padding:0;overflow:hidden;margin:0;width:100%;
max-width:468px;}
.header-right img {display:block;}
.Header h1,.Header h2 {margin-bottom:0;}

@media screen and (max-width:960px) {
#header h1,#header p,#header,.header-right,#header .description{margin:0 auto;width:100%;float:none;text-align:center;}
#header {margin:20px auto;padding:0 30px;background:transparent;max-width:80%;}
.header-right img, .header-right iframe{margin:0 auto;max-width:100%;}
#header-wrapper{padding:0;margin:20px auto;}}

@media only screen and (max-width:640px){
#header h1,#header p,#header,.header-right,#header .description{margin:0 auto;width:100%;float:none;text-align:center;}
.header-right{float:none;margin:0 auto;text-align:center;}
.header-right img, .header-right iframe{float:none;margin:0 auto;text-align:center;}
#header-wrapper{padding:0;margin:20px auto;}
#header {min-width:initial;background:none;margin:20px auto;padding:0 5px;}
#header .description {font-size:100%;line-height:1.5;}}

Langkah 4

Save atau Simpan Template… Selesai

Demikian Tutorial Cara Membuat/Mengganti Header Blog Menjadi 2 Kolom Responsive, Jika permasalah terkait dengan tips diatas silahkan isikan problem serta keluhan pada kotak komentar atau hubungi Admin melalui Kontak Form yang tersedia….Terima kasih , semoga bermanfaat….

Jangan lupa share ya…Sob
Buka Komentar