• Resolved rubbershark

    (@rubbershark)


    Hi guys, hoping you can help me with this one. We have limited knowledge of WordPress unfortunately and we’d like to have each page on our WordPress site have a different template.

    Basically at this link: https://www.anchorhotelhaydonbridge.com/newsite/?page_id=10

    This shows some white square thumbnails. This is set as a background image in the css. These are the images we want to be different on every page. We’ve created another template but can’t seem to link in the new line of css.

    Not sure if I’m explaining myself properly here but hopefully you know what we’re trying to do!

    Thanks in advance,

    Paul

Viewing 3 replies - 1 through 3 (of 3 total)
  • Read this article. It will explain how to name your php templates so that they are called in for specific pages.

    https://codex.www.ads-software.com/Template_Hierarchy

    Be sure to look at the full-size image of the Visual Overview.

    Thread Starter rubbershark

    (@rubbershark)

    Hi Jonas, thanks for the quick reply.

    I’ve successfully created additional templates but now what I need to do is create different background images per template.

    The templates I have created are pulling in ‘header.php’ files and within this file must be some code saying to pull in a certain style from the style.css. This piece of code I unfortunately cannot see or understand.

    The line of code I have added into my style.css file is:
    bodyturn { background:#ffffff url(images/main_bg3.gif) top center repeat-x; font:13px Arial, Verdana, Helvetica, sans-serif; color:#494949; padding:0; margin:0; }

    The only line of code I can see that’s relevant in my original ‘header.php’ file is this:
    <?php wp_head(); ?>
    </head>
    <?php if (is_front_page()) { ?>
    <body class=”html_bg”>
    <?php } else { ?>
    <body>
    <?php } ?>

    My theme has a different template for the home page which is calling in ‘html_bg’. The original default template was calling in ‘body’ both of which are found in my style.css

    Does this make any sense to you and do have any ideas?

    Thanks in advance,

    Paul

    Thread Starter rubbershark

    (@rubbershark)

    This thread is now complete. I decided not to go down the ‘create different templates and header files’ route. Instead I applied different css body classes depending on my page id number. See this thread for more info:

    https://www.ads-software.com/support/topic/show-a-different-background-image-on-different-pages?replies=1

    Regards,

    Paul

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Creating individual templates for each page’ is closed to new replies.