Archived

This topic is now archived and is closed to further replies.

  • 0

Url In Php

Question

Posted · Report post

Hi All

 

I am working on a section for our website and i am having a problem with the image url.

 

The code below gives me the location of wp-content/themes/imsm-website-child-theme/sections/pagelines-sections/images/ourimage.gif and it needs to be wp-content/themes/imsm-website-child-theme/images/ourimage.gif

 

            if (ploption('business_image'))
                    printf('<img src="%s">' , $this->base_url. "/images/" .$business_image);                
                echo'</div>';  

 

Can anyone help with a fix as it driving me crazy

 

Cheers

 

Alex

Share this post


Link to post
Share on other sites

4 answers to this question

Posted · Report post

without the $this-> 

get_stylesheet_directory_uri() is a core wp function.

1 person likes this

Share this post


Link to post
Share on other sites

Posted · Report post

I have already tried to replace $this->base_url. with $this->get_stylesheet_directory_uri(); it breaks the theme

Share this post


Link to post
Share on other sites

Posted · Report post

Ok, I get it now makes complete sense, Thank you simon.

Share this post


Link to post
Share on other sites