Warning: Constant ABSPATH already defined in /home/killersi/public_html/magazine/wp-config.php on line 22

Warning: Cannot modify header information - headers already sent by (output started at /home/killersi/public_html/magazine/wp-config.php:22) in /home/killersi/public_html/magazine/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/killersi/public_html/magazine/wp-config.php:22) in /home/killersi/public_html/magazine/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/killersi/public_html/magazine/wp-config.php:22) in /home/killersi/public_html/magazine/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/killersi/public_html/magazine/wp-config.php:22) in /home/killersi/public_html/magazine/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/killersi/public_html/magazine/wp-config.php:22) in /home/killersi/public_html/magazine/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/killersi/public_html/magazine/wp-config.php:22) in /home/killersi/public_html/magazine/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/killersi/public_html/magazine/wp-config.php:22) in /home/killersi/public_html/magazine/wp-includes/rest-api/class-wp-rest-server.php on line 1758

Warning: Cannot modify header information - headers already sent by (output started at /home/killersi/public_html/magazine/wp-config.php:22) in /home/killersi/public_html/magazine/wp-includes/rest-api/class-wp-rest-server.php on line 1758
{"id":1894,"date":"2010-11-22T06:51:08","date_gmt":"2010-11-22T11:51:08","guid":{"rendered":"http:\/\/www.killersites.com\/magazine\/?p=1894"},"modified":"2010-11-07T19:51:53","modified_gmt":"2010-11-08T00:51:53","slug":"killersites-forum-blog-repeating-sections-of-code-on-many-pages","status":"publish","type":"post","link":"http:\/\/www.killersites.com\/magazine\/2010\/killersites-forum-blog-repeating-sections-of-code-on-many-pages\/","title":{"rendered":"Killersites Forum Blog – Repeating Sections of Code On Many Pages"},"content":{"rendered":"

\"Forum\"<\/a>
\nHey Everyone,<\/p>\n

This week on The Killersites Forum Blog, we take a look at a really insightful post from the Killersites Forum<\/a> on how to create repeating sections of code on numerous pages.<\/p>\n

Repeating Sections of Code On Many Pages <\/strong><\/a><\/p>\n

Question:<\/strong>– I’ve got a site with 100 pages and I don’t want to edit the
\nmenu on every page.<\/p>\n

Answer:<\/strong>– Form one page complete in the normal way with the menu and
\ncheck that it validates and displays properly.<\/p>\n

Open up Notepad or a text editor (not Word) and cut the code that
\nrepeats in every page completely (as much or as little as you want,
\nwithout doctype, html, head or body tags) and paste it into Notepad and
\nsave as an “include” file called menu.inc. You then have only one file to
\nedit if the menu changes.<\/p>\n

Substitute the code you have cut out with PHP code<\/p>\n

in the main file and save it with .php filename extension instead of .html
\nor .htm.<\/p>\n

Do the same with other main pages where the menu repeats.
\nYou can use .txt, .php, .html or .htm for the “include” file but it
\ndistinguishes it as an “include” file in your file list if you use .inc as the
\nfilename extension and it’s even better if you put all “include” files in a
\ndifferent directory\/folder.<\/p>\n

If you use a complete page as an “include” file with .html or .htm for the
\nfilename extension the final processed page will have two doctypes, two
\nhtml tags, two head sections, etc. in an unusual place which is not a
\ngood idea.<\/p>\n

You can have different “include” files on the same main pages for header
\nand footer and even use “includes” for the parts of the head section that
\nrepeat.<\/p>\n

The PHP code needs to be processed by a server before the result can
\nbe seen, either by the hosting service’s server just before downloading or
\nby a server like WAMP (which includes Apache) on your computer for
\nlocal viewing.<\/p>\n

SHTML works the same way but the “include” file must have .txt
\nfilename extension and the main pages have the code and the .shtml filename extension.<\/p>\n

Check that your hosting service supports PHP or SHTML as free
\nwebspaces provided by ISPs usually do not.<\/p>\n

Stefan has 2 great video tutorials explaining exactly this in the PHP tutorials: PHP includes part 1<\/a> and PHP includes part 2<\/a> from the PHP Basics Course.<\/a><\/p>\n

Not sure if this is in the videos – but it’s generally a good idea, especially if the site is set up with sub-folders, to use the absolute paths pointing to the include files, and for anything the include itself points to – that can save a lot of wondering why something suddenly isn’t showing up. <\/p>\n

Written by: Wickham<\/strong><\/p>\n

You can take a look and get involved with the original post and discussions here!<\/a><\/p>\n

Thanks,<\/p>\n

Jody
\nKillersites.com<\/p>\n","protected":false},"excerpt":{"rendered":"

Hey Everyone, This week on The Killersites Forum Blog, we take a look at a really insightful post from the Killersites Forum on how to create repeating sections of code on numerous pages. Repeating Sections of Code On Many Pages Question:– I’ve got a site with 100 pages and I don’t want to edit the […]<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[93],"tags":[68,90,189],"_links":{"self":[{"href":"http:\/\/www.killersites.com\/magazine\/wp-json\/wp\/v2\/posts\/1894"}],"collection":[{"href":"http:\/\/www.killersites.com\/magazine\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.killersites.com\/magazine\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.killersites.com\/magazine\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"http:\/\/www.killersites.com\/magazine\/wp-json\/wp\/v2\/comments?post=1894"}],"version-history":[{"count":12,"href":"http:\/\/www.killersites.com\/magazine\/wp-json\/wp\/v2\/posts\/1894\/revisions"}],"predecessor-version":[{"id":1908,"href":"http:\/\/www.killersites.com\/magazine\/wp-json\/wp\/v2\/posts\/1894\/revisions\/1908"}],"wp:attachment":[{"href":"http:\/\/www.killersites.com\/magazine\/wp-json\/wp\/v2\/media?parent=1894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.killersites.com\/magazine\/wp-json\/wp\/v2\/categories?post=1894"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.killersites.com\/magazine\/wp-json\/wp\/v2\/tags?post=1894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}