Ways to call image in no wordpress

0

Next

        <div class="site-branding">
              <img src="http://sitedementirinha.com.br/wordpress/wp-content/themes/alizee/images/logo1.png"/>
        </div>

I have this code in a Wordpress theme, but it does not load the logo.png on either a browser or a mobile device, I've already changed the image 10 times and it has not worked if someone can give me another alternative. thankful.

    
asked by anonymous 13.11.2017 / 13:49

3 answers

0

When it comes to wordpress there are things to facilitate this for example this would already call your theme try so

<?php $template_directory = get_template_directory_uri(); ?>
<div class="site-branding">
   <img src="<?php echo $template_directory;?>/images/logo1.png"/>
</div>
    
13.11.2017 / 13:55
0
  • Check the image path, access the logo link directly in the browser and see if the image opens or not.
  • View the permissions of the folder where the image is located, usually using 644 , but in case of tests you can put 777 or 755 .
  • There are several dynamic ways to add images to the template, Anderson quoted one. You can find others at Wordpress Documentation
  • Check files as .htaccess , it may be doing some redirect wrong (hard to happen, but will that ...)
  • Clean your site and browser cache, especially if you're using some speed optimization plugin.
  • 13.11.2017 / 14:07
    0

    There may be a lock in .htaccess or directory permissions.

    A tip I really like to use in cases like this is:

  • Upload the image inside Wordpress through the media menu.
  • Copy the generated url to the uploaded image.
  • Use this link within the theme.
  • If this does not work then no image will work inside your installation, as this is how the images are inserted into the posts, thumbnails, etc.

        
    15.11.2017 / 17:55