user379888
user379888

Reputation:

Website not displaying images

I am creating a custom WordPress page tempalate. I followed the guidelines on the WordPress website and created a page template and uploaded it, but I am having a problem: the images are not loading.

I am sure that I have placed the images correctly. Here is my site.

I have a folder Pk_files containing all the images in the directory rockwell (theme name) but it is not loading the images. Any idea?

Here is my code,

<?php
/*
Template Name: Packages
*/
?>
<?php get_header(); ?>
<html><head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"><style type="text/css">
#index_contentbg {
    clear: both;
    padding: 10px 35px 15px;
    width: 890px;
    font-family: 'Trykker', serif;
}

#video_blue_box {
    background: url("http://www.99centarticles.com/css/../images/vbb_bg.jpg") repeat-x scroll 0 0 transparent;
     clear: both;
    height: auto;
    padding: 10px 35px 15px;
    width: 890px;
    text-align:center;
    font-family: 'Trykker', serif;
}
</style>
<link href="Pk_files/css.css" rel="stylesheet" type="text/css">


</head><body><div id="video_blue_box">
<h2>Our Packages</h2></div>

<div id="index_contentbg">
<p>Below are our package deals, order now and get <strong>20% Extra.</strong></p>
</div>



<div id="video_blue_box">
<h2>500 Word Article Writing Package</h2>
</div>
<div id="index_contentbg"><img src="Pk_files/firsty.PNG" height="525" width="347"></div>
<div id="video_blue_box">
<h2>Quality Article Writing + Our Signature Submission Method</h2>
</div>
<div id="index_contentbg">
  <p><img src="Pk_files/1.PNG" align="absmiddle" height="539" width="341"></p>
</div>

<div id="video_blue_box">
<h2>Custom Articles - You Choose Word Count and Quantity</h2>
</div>
<div id="index_contentbg">Please contact us through or contact form for the quote.</div>

<div id="video_blue_box">
<h2>Press Release Writing</h2>
</div>
<div id="index_contentbg">
  <p><img src="Pk_files/5.PNG" height="428" width="351"></p>
</div>


<div id="video_blue_box">
<h2>Press Release Writing + Our Signature Submission Method</h2>
</div>
<div id="index_contentbg">
  <p><img src="Pk_files/6_1.PNG" alt="" height="393" width="824"></p>
  <p><img src="Pk_files/6_2.PNG" height="390" width="804"></p>
  <p><img src="Pk_files/6_3.PNG" height="388" width="794"></p>
  <p>&nbsp;</p>
  <p>&nbsp;</p>
</div>


<div id="video_blue_box">
<h2>Drive Traffic Marketing Videos</h2>
</div>
<div id="index_contentbg"><img src="Pk_files/7_1.PNG" height="292" width="339"></div>
<div id="video_blue_box">
  <h2>Premium Website / Sales Page Videos</h2>
</div>
<div id="index_contentbg">Please contact us through or contact form for the quote.</div>
<div id="video_blue_box">
<h2>Custom Facebook Fan Page</h2>
</div>
<div id="index_contentbg">
  <p><img src="Pk_files/7_2.PNG" height="288" width="343"></p>
</div>
<div id="video_blue_box">
  <h2>Custom Sales Page</h2>
</div>
<div id="index_contentbg">
  <p>&nbsp;</p>
<img src="Pk_files/8_1.PNG" height="221" width="342"></div>
<div id="video_blue_box">
<h2>Custom Blog Design/Wordpress Theme</h2>
</div>
<div id="index_contentbg">Please contact us through or contact form for the quote.</div>
<div id="video_blue_box">
<h2>Custom Facebook Fanpage</h2>
</div>
<div id="index_contentbg"><img src="Pk_files/9.PNG" height="98" width="342"></div>
<div id="video_blue_box">
<h2>Link Building Service</h2>
<p>&nbsp;</p>
</div>
<div id="index_contentbg"><img src="Pk_files/11.PNG" height="84" width="336"></div>
<div id="video_blue_box">
<h2>Blog Commenting SEO Service</h2>
</div>
<div id="index_contentbg">
  <p><img src="Pk_files/12.PNG" height="346" width="344"></p>
</div>
<div id="video_blue_box">
<h2>.EDU Linking SEO Service</h2>
</div>
<div id="index_contentbg"><img src="Pk_files/13.PNG" height="285" width="346"></div>
<?php get_footer(); ?> 

Upvotes: 0

Views: 254

Answers (2)

Mario Peshev
Mario Peshev

Reputation: 1083

Just a side note - bloginfo with url paremeters are deprecated (or at least not recommended) and usage of functions such as get_template_directory_uri are required.

Upvotes: 0

Pekka
Pekka

Reputation: 449783

My browser console is full of 404 messages for URLs like this:

 http://bestseoarticlewriters.com/121-2/Pk_files/6_3.PNG

the most likely explanation is that you used relative paths in your template: relative paths will always resolve relative to the current page, not the actual template path that the HTML is coming from! (The only exception is for CSS files, whose paths will always resolve relative to the CSS file.)

Use absolute URLs, or more preferably, use Wordpress' bloginfo():

<img src="<?php bloginfo('template_directory'); ?>/Pk_files/6_3.PNG">

that is the canonical way to address images in a template.

Upvotes: 4

Related Questions