• Resolved scotto87

    (@scotto87)


    ******* I’VE ADDED AN UPDATE TO THE BOTTOM *******

    Hi,

    I’m having a confusing problem at the moment, one of which I feel as though I’m being thick by not solving straight away!

    This is the problem:

    I have a website, built perfectly all working nice and great. I have two main pages, one the homepage (page.php) and a general template page for the rest of the site (general_page.php).

    On the homepage I have images which path diretories are (_img/image.jpg) this is all fine and dandy as the (_img) folder and all the images are within my theme folder.

    I’ve set up permalinks to display as the title. So basically /title/ this will display https://www.website.com/pagetitle/title etc….

    When I click on another page e.g. ‘About Us’ the images within the ‘general_page.php’ should work, but instead they are looking inside of the ‘about us’ folder (which obviously doesn’t exist!

    I’ve tried using (../_img/image.jpg) but this then causes problems for the home page as it is trying to search folders which don’t exist.

    Sorry if this sounds confusing!!!

    Cheer
    Scott

    ******* UPDATE ******* UPDATE ******* UPDATE *******

    Just a quick update, i’ve changed the permalinks to just ‘/title’ and this seems to have fixed the main navigation pages. But all the sub pages are still broken.

    To sum it up, I need the sub pages images to be pointing the the main _img directory folder, instead they are looking inside their parents folder for _img.

    I could fix this and work around it using a seperate template for the sub pages, but do I have to do this? or do I not have a choice but to create a new template for all the sub pages.

Viewing 2 replies - 1 through 2 (of 2 total)
  • That’s because you are using a relative path without the leading slash. try something like this

    <img src="<?php bloginfo('template_url'); ?>/_img/logo.gif"/>

    Thread Starter scotto87

    (@scotto87)

    Fantastic, that solved it.

    Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Image Directory / Sub Page’ is closed to new replies.