Jump to content
alexcox6

Url In Php

Recommended Posts

alexcox6    0
alexcox6

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
alexcox6    0
alexcox6

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
Simon    247
Simon

without the $this-> 

get_stylesheet_directory_uri() is a core wp function.

  • Like 1

Share this post


Link to post
Share on other sites
alexcox6    0
alexcox6

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×