• Resolved Laxus Mcfury

    (@laxusmcfury)


    Hi there!
    I have some logos on Header and footer along with some social media icons that are appearing on all pages but post page (single.php) and i can’t seem to figure out how to fix it, any ideas?

    index.php

    <?php get_header(); ?>

    <div id=”sidebar”><?php get_sidebar(); ?></div>

    <div id=”loop”>
    <?php
    while(have_posts()){
    the_post(); ?>
    <div id=”the_title”><h1>“><?php the_title(); ?></h1></div>
    <div id=”the-content”><?php the_content(); ?></div>
    <div class=”date”><?php the_time( ‘M j y’ ); ?></div>
    <?php }
    ?>
    </div>

    <?php edit_post_link(); ?>

    <div class=”alignleft”><?php next_posts_link( ‘PREV’ ); ?></div>
    <div class=”alignright”><?php previous_posts_link( ‘NEXT’ ); ?></div>

    <?php get_footer(); ?>

    single.php

    <?php get_header(); ?>

    <div id=”sidebar”><?php get_sidebar(); ?></div>

    <div id=”loop”>
    <?php
    while(have_posts()){
    the_post(); ?>
    <div class=”date”><?php the_time( ‘M j y’ ); ?></div>
    <h2><?php the_title(); ?></h2>
    <div id=”the-content”><?php the_content(); ?></div>
    <?php }
    ?>
    </div>

    <?php edit_post_link(); ?>

    <?php get_footer(); ?>

    Screenshot from single.php
    Screenshot from from other pages

    • This topic was modified 5 years, 11 months ago by Laxus Mcfury.
    • This topic was modified 5 years, 11 months ago by Laxus Mcfury.
    • This topic was modified 5 years, 11 months ago by Laxus Mcfury.
    • This topic was modified 5 years, 11 months ago by Laxus Mcfury.
    • This topic was modified 5 years, 11 months ago by Laxus Mcfury.
    • This topic was modified 5 years, 11 months ago by Laxus Mcfury.
    • This topic was modified 5 years, 11 months ago by Laxus Mcfury.
Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi,

    Is there any chance that you could attach a link to the page where the images are not loaded? This looks like a problem with the way that things are loaded and I might be able to help you with that.

    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    Moved to Fixing WordPress, please do not use Requests and Feedback for these topics.

    Thread Starter Laxus Mcfury

    (@laxusmcfury)

    Hi,

    Is there any chance that you could attach a link to the page where the images are not loaded? This looks like a problem with the way that things are loaded and I might be able to help you with that.

    Sure here’s the sample, when you click on Hello World post or any post, header logo and any type of image is gone!
    i really hope you can help me i’m so stuck that i’m thinking about giving up on wordpress

    http://theghostsoldier.rf.gd/dir/

    Hi,

    There’s no reason to give up on WordPress. The whole community is here to help when you get stuck. We all started from 0 but the main advantage is that everybody is willing to help you learn everything you need.

    Regarding your problem, I think I know what’s the source of it. Could you attach the content of the header.php file, please? That’s the place that I need to check and get things fixed.

    Thread Starter Laxus Mcfury

    (@laxusmcfury)

    it’s because it’s been a weak of searching and trying things and it was frustrating and asking for help here is my last hope… thank you for taking the time and trying to help

    Here’s the whole sample theme
    here’s the header.php code

    <!DOCTYPE html>
    <html>
    <head>
    <?php wp_head(); ?>
    </head>
    <body>
    <header>
    <div id=”menu”>
    </div>
    <div class=”container”>
    <div id=”brand”>
    Home
    </div>
    </div>
    </header>

    • This reply was modified 5 years, 11 months ago by Laxus Mcfury.

    Hi,

    The problem is on the link of the header/footer logos. Here’s how the header.php should look like:

    <!DOCTYPE html>
    <html>
    	<head>
    		<?php wp_head(); ?>
    	</head>
    	<body>
    		<header>
    			<div id="menu">
    			</div>
    			<div class="container">
    				<div id="brand">
    					/images/Brand/header_brand.png" alt="Home">
    				</div>
    			</div>
    		</header>

    Can you copy this on your side and give it a try?

    And here is the footer.php file:

    <!DOCTYPE html>
    <html>
    	<head>
    		<?php wp_head(); ?>
    	</head>
    	<body>
    		<header>
    			<div id="menu">
    			</div>
    			<div class="container">
    				<div id="brand">
    					/images/Brand/header_brand.png" alt="Home">
    				</div>
    			</div>
    		</header>
    
    Thread Starter Laxus Mcfury

    (@laxusmcfury)

    It didn’t work, i tried that before <img src="/images/Brand/header_brand.png" /> does not load images in any page, at least <img src="wp-content/themes/theme name/images/Brand/header_brand.png" /> loads images in all pages except for single.php page…

    here’s the result
    http://theghostsoldier.rf.gd/dir/

    • This reply was modified 5 years, 11 months ago by Laxus Mcfury.
    • This reply was modified 5 years, 11 months ago by Laxus Mcfury.

    Hi,

    I just checked the code I posted here but it seems that it’s not the one that I really used.
    Please download the theme with the changes I made from here: https://ufile.io/bh2sn and use it on your website. I’m sure that this time everything will work fine no matter what page you’ll check.

    Thread Starter Laxus Mcfury

    (@laxusmcfury)

    Thank you so much, it worked!
    looking at the code, i’ve seen this solution somewhere when i was searching but it was used in css instead of html so i ignored it, now i know how to avoid this issue, thanks again!

    <img src="<?php echo get_template_directory_uri(); ?>/images/(image.png)" alt="">

    • This reply was modified 5 years, 11 months ago by Laxus Mcfury.
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘images in header and footer are appearing in every page but post page’ is closed to new replies.