WordPress.org

Ready to get started?Download WordPress

Forums

Please Help (3 posts)

  1. damir.lukina
    Member
    Posted 1 year ago #

    I'm new to WordPress and i'm trying to port my existing html/css/JavaScript webpage to a WordPress theme.

    I'm running into 2 problems:

    1. I cant get my images to display on the site!

    http://ministryofbeauty.hr/

    CODE:

    DOSEN'T WORK
    <img src="http://ministryofbeauty.hr/wp-content/themes/ministry_of_beauty/img/logo.png" alt="Ministry Of Beauty Logo" id="mob_logo" class="image";/>

    DOSEN'T WORK
    <img src="<?php bloginfo('template_directory');?> /img/logo.png" alt="Ministry Of Beauty Logo" id="mob_logo" class="image";/>

    CSS
    .image{
    border:none;
    }

    The image files are located at: http://ministryofbeauty.hr/wp-content/themes/ministry_of_beauty/img

    2. Goolge crome does something wired with catching and brakes my site:

    The first time you load http://ministryofbeauty.hr/ in google chrome it is ok but if you hit reload the structure falls apart.
    Hiting ctrl+F5 (reload with clearing catche) it works normal.
    In other browsers it works great.

  2. s_ha_dum
    Member
    Posted 1 year ago #

    It does not work great in other browsers. In fact, it hardly works at all. All of your images are returning a 404 status.

    Either your images are not where you think they are ( 404 -> http://ministryofbeauty.hr/wp-content/themes/ministry_of_beauty/img/logo.png ) or the filesystem permissions as preventing them from being read. However, your images are (failing to) load from two different addresses from the one given-- http://ministryofbeaty.hr/img/ or http://ministryofbeaty.hr/temp/

    Part of the problem is that you are using relative addresses-- <img src="img/logo.png" alt="Ministry Of Beauty Logo" id="mob_logo" class="image";/> (spurious semi-colon in there, at the end. That spurious semi-colon is in your code above too.). You need to be using absolute URLs-- <img src="http://ministryofbeauty.hr/wp-content/themes/ministry_of_beauty/img/logo.png" alt="Ministry Of Beauty Logo" id="mob_logo" class="image"/>. The use of bloginfo('template_directory'); should take care of that, although your code here-- <img src="<?php bloginfo('template_directory');?> /img/logo.png" is wrong. You have a space in the URL right before "/img". That isn't going to work.

    None of this will fix the fact that images like this one don't show up. Check your file permissions.

  3. damir.lukina
    Member
    Posted 1 year ago #

    Thank you for your support.
    I decided to stick with the structure of my design and to implement WordPress on top of my site.
    It simplifies things a lot.

    The design as it shod be displayed:
    Ministry Of Beauty

    Thank you again for your time and the problem was with read write permissions as you mentioned above.

Topic Closed

This topic has been closed to new replies.

About this Topic