Title: PHP Include
Last modified: August 21, 2016

---

# PHP Include

 *  Resolved [Michael Klasno](https://wordpress.org/support/users/michael-klasno/)
 * (@michael-klasno)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-include-7/)
 * Code HELP Please –
 * I have created a few HTML Blocks (intro’s) that I want to include at the beginning(
   before the list of posts) as the different category pages load.
 * NOTE: I had this code once upon a time and don’t have the original blog any longer,
   so i know it works for what I want to do
 * What I need is the include code to say this:
 * IF CATEGORY and CATEGORY IS (ID HERE) LOAD xxxx.HTML
    Else if – CATEGORY IS (
   ID HERE) LOAD xxxx.HTML Else if CATEGORY IS (ID HERE) LOAD xxxx.HTML
 * ALSO which page template would i place it on.
 * THANK YOU – Thank You for your help
 * Michael

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Michael Klasno](https://wordpress.org/support/users/michael-klasno/)
 * (@michael-klasno)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-include-7/#post-5064142)
 * OK, I will try to explain a little better. As I said I AM NO CODEX WIZ>
 * I have created a few HTML Blocks (intro’s) that I want to include at the beginning(
   before the list of posts) as the different category pages load.
 * here is what I want to say
 * <?php if (is_category(‘Category A’)) : ?>
    <?php get( $ abc.html ); ?> Elseif(
   is_category(‘Category B’)) : ?> <?php get( $ xyz.html ); ?> Elseif (is_category(‘
   Category c’)) : ?> <?php get( $ 123.html ); ?> Elseif (is_category(‘Category 
   d’)) : ?> <?php get( $ 456.html ); ?> <?php endif; ?>
 * Am I close/ can anyone fix this for me?
 * I believe it will go into category.php?? formatted with .css and a DIV tag.?
 * Thank You in advance.
    michael
 *  Thread Starter [Michael Klasno](https://wordpress.org/support/users/michael-klasno/)
 * (@michael-klasno)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/php-include-7/#post-5064143)
 * OK, If anyone is interested I figured it out. Here is the actual code for category.
   php
 * >>>>>>
 * <?php if (in_category(’16’) && is_category() )
    include(TEMPLATEPATH.’/news-tease.
   html’); ?> <?php if (in_category(‘6’) && is_category() ) include(TEMPLATEPATH.’/
   pastors-prospective.html’); ?> <?php if (in_category(’39’) && is_category() )
   include(TEMPLATEPATH.’/guest-tease.html’); ?> <?php if (in_category(‘101’) &&
   is_category() ) include(TEMPLATEPATH.’/vantage-tease.html’); ?>
 * >>>>>>>>>
    here is the actual category 16 /news-tease.html file >>>>>>>>>>>>
 * <h3 align=”center”>In the News</h3>
 *  <h4 align=”left”>This section of our website contains stories that our editors
   actually found in other national newspapers and periodicals. Some are actual “
   News” while most are just human interest stories we found uplifting. We hope 
   you enjoy these and if you come across a “Good News” story in your local paper
   that you would like to share with other believers please send us the link. </
   h4>
 *  <hr />
 * You can see it here .. [http://goodnewsandpraise.com/category/the-news/](http://goodnewsandpraise.com/category/the-news/)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP Include’ is closed to new replies.

## Tags

 * [loop](https://wordpress.org/support/topic-tag/loop/)
 * [php include](https://wordpress.org/support/topic-tag/php-include/)

 * 2 replies
 * 1 participant
 * Last reply from: [Michael Klasno](https://wordpress.org/support/users/michael-klasno/)
 * Last activity: [11 years, 10 months ago](https://wordpress.org/support/topic/php-include-7/#post-5064143)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
