WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Body Class changes on single post pages (3 posts)

  1. fbbr
    Member
    Posted 1 year ago #

    I have noticed that the body class changes from:

    <body class="home blog custom-background"> on my blog home page (http://www.freebetreview.com.au/blog/)

    to

    <body class="single single-post postid-55 single-format-standard custom-background"> on the pages showing just the individual post.

    It means that the images which are part of the page design are not showing on the post pages. Can anyone point me in the right direction? I head read many posts but cannot find the exact solution.

  2. alchymyth
    The Sweeper & Moderator
    Posted 1 year ago #

    http://codex.wordpress.org/Function_Reference/body_class

    It means that the images which are part of the page design are not showing on the post pages.

    how are those images added into the design?

    it seems that you are using relative image paths - change to absolute paths.

    example:

    <img src="<?php echo get_stylesheet_directory_uri(); ?>/images/yourimage.png" />

    http://codex.wordpress.org/Function_Reference/get_stylesheet_directory_uri

    body_class() would only be relevant if you use css to show the images as background images.

  3. fbbr
    Member
    Posted 1 year ago #

    Many thanks,

    The <img src="<?php echo get_stylesheet_directory_uri(); ?> worked a treat.

    Much appreciated.

Topic Closed

This topic has been closed to new replies.

About this Topic