WordPress.org

Ready to get started?Download WordPress

Forums

Custom include files (1 post)

  1. webmiss
    Member
    Posted 1 year ago #

    Hope I can explain what I am wanting to do. On a current site, which is not wordpress, we have several pages that relate to specific cities. Each of these city pages has a unique address as well as a google map to that address showing on the page itself.
    This information is being pulled in from two include files, one for the map and one for the actual address.
    At the top of each page in the header section I have this code:
    For the map:
    <?php
    include '/path/to/the/inclue-file/inc_map_some_city_name.php';
    ?>
    For the address:
    <?php
    include '/path/to/the/inclue-file/inc_some_city_name.php';
    ?>

    This allows me to show the city, or phone number or full address within the content of the page. Like so, here are some examples:

    <? echo ''.$city.''; ?>, if I just want the city name to show up in the content, or <? echo ''.$phone.''; ?>, if I just want the phone # to show up in the content.

    The map is in a sidebar on the page.

    At the top of each page in the header section I have this code:
    For the map:
    <?php
    include '/path/to/the/inclue-file/inc_map_some_city_name.php';
    ?>
    For the address:
    <?php
    include '/path/to/the/inclue-file/inc_some_city_name.php';
    ?>

    We are wanting to use wordpress for this site and are wondering if something like this is possible in wordpress. Each include file has a different name and I'm not sure how to address this issue in wordpress if possible.

Topic Closed

This topic has been closed to new replies.

About this Topic