WordPress.org

Ready to get started?Download WordPress

Forums

Template within a Template? (4 posts)

  1. dodgersandstorm
    Member
    Posted 5 years ago #

    I'm working on a webpage where I will have multiple pages (http://squarecouture.com) and they are all supposed to match. Each one will be a store profile that will look something like this:

    Store Hours: 3:00-4:00
    Store Location: 1881 Soandso St.

    I am trying to make sure that if I want to change it (make the first part bold instead of italics, for instance) I won't have to go through each individual to page. Is there a way to do this?

  2. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    Create a PHP file say, profile.php and put in the Store Hours and Store Location info and html and upload it to your theme folder.

    You can insert profile.php into the area where you want it by adding the code below to page.php or custompage.php
    <?php include(TEMPLATEPATH."/profile.php");?>
    Good luck.

  3. dodgersandstorm
    Member
    Posted 5 years ago #

    That would make it so that I could change the style of every label (Store Hours:, etc.) on every page at once?

  4. @mercime
    Volunteer Moderator
    Posted 5 years ago #

    Yes. You can:
    1) change info in profile.php and all the pages with that included will just info at same time (clear your cache to make sure you're seeing the updated page)
    2) change the style in style.css for the div/span ID or class you set up for the info in profile.php and it will affect all pages with profile.php included (clear cache, can't say it often enough)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.