In WP where do I put custom code for specific post if some of it has to go in the header?

Rambo the Great

Junior Member
Joined
Jun 30, 2014
Messages
154
Reaction score
12
I want to use this code for an image gallery:

Code:
 <html>
<head>
<style>
div.img   {
      margin: 5px;
    padding: 5px;
    border: 1px solid #0000ff;
          height: auto;
      width: auto;
          float: left;
      text-align: center;
  }
    
div.img img   {
      display: inline;
          margin: 5px;
      border: 1px solid #ffffff;
  }
    
div.img a:hover img   {
        border:1px solid #0000ff;
  }
    
div.desc   {
          text-align: center;
      font-weight: normal;
          width: 120px;
      margin: 5px;
  }
</style>
</head>
<body>

<div class="img">
      <a target="_blank" href="klematis_big.htm">
          <img src="klematis_small.jpg" alt="Klematis" width="110"   height="90">
      </a>
      <div class="desc">Add a description of the image here</div>
</div>
<div class="img">
      <a target="_blank" href="klematis2_big.htm">
      <img src="klematis2_small.jpg" alt="Klematis" width="110"   height="90">
      </a>
      <div class="desc">Add a description of the image here</div>
</div>
<div class="img">
      <a target="_blank" href="klematis3_big.htm">
      <img src="klematis3_small.jpg" alt="Klematis" width="110"   height="90">
      </a>
      <div class="desc">Add a description of the image here</div>
</div>
<div class="img">
      <a target="_blank" href="klematis4_big.htm">
      <img src="klematis4_small.jpg" alt="Klematis" width="110"   height="90">
      </a>
      <div class="desc">Add a description of the image here</div>
</div>

</body>
</html>

but where does the header stuff go? cos I cant just dump it in the text part of the post can i?
 
Last edited:
You paste everything between <style></style> in style.css in your theme folder and between <body></body> where you want to show the images.
You may need to give those style sub ids tho, as they might mess with your theme style otherwise.
 
I realised a much simpler solution was finding a plugin :P.

Still messing around with coding my own sites from scratch but it seems to be easier to either do it one way or the other.
 
Back
Top