Wordpress reads logo only on localhost

Asked

Viewed 67 times

1

On the site I made the logo works when I’m testing at home with the localhost, but on the site it doesn’t read.

<img id="logo_topo" class="img-responsive" src="<?php bloginfo('template_url'); ?>/imagens/logo.png" alt="Logo" />

When inspecting the element src in localhost mode is:

src="http://localhost/site/wp-content/themes/site_tema/imagens/logo.png"

On the site it looks like this:

src="/site/wp-content/themes/site_tema/imagens/logo.png"

Anyone can help?

  • 1

    Voce already switched the siteurl in wp_options?

  • I already put it there yes, it’s like "http://site.com.br/" in the siteurl field and in the home field, "h t t p : / /" doesn’t appear here, but it’s in db

  • Actually Pedro, my stylesheet is with this problem too, it looks like this <link id="style_cor" rel="stylesheet" href="/site/wp-content/themes/site/style/padrao/style.css" type="text/css" media="screen"> but does not read

  • tries to put the stylesheet path straight from the server, as if it would look like this <link id="style_cor" rel="stylesheet" href="http://site.com/wp-content/themes/site/style/padrao/style.css" type="text/css" media="screen"> or Voce can try <link id="style_cor" rel="stylesheet" href="<?php bloginfo('template_url'); ?>/wp-content/themes/site/style/padrao/style.css" type="text/css" media="screen">

  • Awesome as it sounds, I did it and it still cuts the beginning of the address and leaves only "/site/wp-content/themes/site_theme/images/logo.png", but I saw that you spoke of the stylesheet, I’ll try and tell you

  • Do the same thing, he cuts the beginning of the address

  • I noticed that the address it generates "http://localhost/site/wp-content" on the web should be "http://site.com.br/wp-content/", but it is "http://site.com.br/site/wp-content/"

  • but the wp-content folder is inside some folder( public_HTML/pasta-exemplo/wp-content) on the server or at the root( public_HTML/wp-content)?

  • this, this so /public_html/site.com.br/wp-content

  • Look at this, in the footer I’m pulling the js <script src="<? php bloginfo('template_directory'); ? >/js/jsitei.js"></script>, and the generated address is thus 'src="http://site.com.br/wp-content/themes/site/js/site.js"''

  • The same bloginfo('template_directory'), in the style <link id="style_cor" rel="stylesheet" href="<? php bloginfo('template_directory'); ? >/style/<? php echo $style_cor_variable; ? >/style.css" type="text/css" media="screen" /> generates this: <link id="style_color" rel="stylesheet" href="/site/wp-content/themes/site/style/padrao/style.css" type="text/css" media="screen">

Show 7 more comments

2 answers

0

Try to leave it just like that:

/wp-content/themes/site/imagens/logo.png

leave only this way and test with CTRL + F5.

Here for me it worked.

0

Change the folder reference to get_template_directory_uri()

Will stay like this:

<img id="logo_topo" class="img-responsive" src="<?php echo get_template_directory_uri(); ?>/imagens/logo.png" alt="Logo" />
  • It’s just as expensive. /site/wp-content/themes/site/images/logo.png

Browser other questions tagged

You are not signed in. Login or sign up in order to post.