Solved

Img not displaying

Posted on 2016-11-15
11
22 Views
Last Modified: 2016-11-15
I'm having trouble with an image not displaying. It only shows the placeholder:

Placeholder
It's probably something basic that I'm missing. Everything else is working okay. The correct images and text is called for each slide. Thanks in advance to anyone who can assist me with this.

<?php 

/** 

 * This file is responsible for the rendering of the header of the front page. 

 */ 

?> 

<!-- Home Slider --> 

<div id="home"> 

    <!-- Banner Image --> 

    <div id="banner_image"> 

    <!-- Banner TEXT Slides --> 

    <div id="text_slider" class="top_slider"> 

        <?php 

        if (get_theme_mod('topslider_slides')) { 

            foreach (get_theme_mod('topslider_slides') as $slide) { 

                ?> 

               <div id="owl-item" class="owl-item">
<!-- CHANGE TO BE THE IMAGE FOR THIS SLIDE -->
   <img src="background-image:url(<?php echo $slide['slide_image']; ?>" />
 <div class="hero_text item"> 

                    <h3><?php echo $slide['slide_title']; ?></h3> 

                    <p><?php echo $slide['slide_desc']; ?></p> 

                </div> 

    </div> 

            <?php 

            } 

        } 

        ?> 
   </div>  

</div> 

<!-- Home Slider --> 

Open in new window


And the CSS

#text_slider {
  background: rgba(0, 0, 0, 0.3) none repeat scroll 0 0;
  color: #fff;
  display: inline-block;
  height: 600px;
  left: 0;
  overflow-y: hidden;
  position: absolute;
  text-align: center;
  top: 0;
}

#owl-item {
 position: relative;
}
.owl-item img {
    background-repeat:no-repeat; 
    background-attachment:fixed; 
    background-size:cover; 
    height:600px;  
    left: 0;
  position: absolute;
  top: 0;
  width: 100%;
  z-index: 1;
}

.owl-theme .owl-controls {
  margin-top: -50px;
  position: relative;
  text-align: center;
  z-index: 10000;
}

.hero_text h3{
    vertical-align: middle;
    font-size: 50px;
    color: #fff;
    font-weight: 400;
    text-transform: uppercase;
}
.hero_text p {
    font-size: 18px;
    color: #fff;
}

Open in new window

0
Comment
Question by:Cathryn Warren
  • 6
  • 5
11 Comments
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 41888964
<?php echo $slide['slide_image']; ?>

Open in new window


apparently, can you check the value of $slide['slide_image'] ?

also check the html output generated, and see if the image pointing too really exists? you may make sure the relative path of the image is set correctly.
0
 

Author Comment

by:Cathryn Warren
ID: 41888982
Thanks Ryan, yes the relative path is correct and it is calling the information correctly. I can see it in the source on the page.
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 41888986
yes the relative path is correct and it is calling the information correctly. I can see it in the source on the page.
could it be browser's cache? are you able to copy the relative path and paste into your browser to show that image alone?
0
 

Author Comment

by:Cathryn Warren
ID: 41888996
I tried this as well. It does work. I have also tried it in multiple browsers, firefox, chrome and edge.
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 41889016
so is that all browsers such as firefox, chrome and edge behaved the same that image not showing up?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:Cathryn Warren
ID: 41889019
That's correct it doesn't show in any of the browsers. But pasting the relative path into each of the browsers does work.
0
 

Author Comment

by:Cathryn Warren
ID: 41889033
If it helps here is a link.
0
 
LVL 49

Expert Comment

by:Ryan Chong
ID: 41889045
<img src="background-image:url(http://www.mitchellwealthmanagement.com.au/wp-content/uploads/2016/11/test_shot.jpg">

Open in new window

shoudn't it be as:

<img src="http://www.mitchellwealthmanagement.com.au/wp-content/uploads/2016/11/test_shot.jpg">

Open in new window


? I think you mass up the CSS with HTML syntax
0
 
LVL 49

Accepted Solution

by:
Ryan Chong earned 500 total points
ID: 41889046
so try this instead:

<img src="<?php echo $slide['slide_image']; ?>" />

Open in new window

1
 

Author Comment

by:Cathryn Warren
ID: 41889064
Yes that was the problem! Thank you!

Now I have a height distortion problem to fix...
0
 

Author Closing Comment

by:Cathryn Warren
ID: 41889065
Thank you Ryan!
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

WordPress has made it easy to create scalable sites based on their powerful CMS, but as great as WordPress is, there are some SEO issues that haven’t been addressed out of the box.  Fortunately these problems can be solved with a few plugins.  The f…
I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to integrate Mailchimp with WordPress, by placing a Mailchimp signup form on a WordPress Page or Post. This will be demonstrated using a Windows 8 PC. Mailchimp will be used. Log into your Mailchi…

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now