# 3 Blog List Pages on 1 Side. Need help modifying so each shows category

**URL:** <https://www.phphelp.com/t/3-blog-list-pages-on-1-side-need-help-modifying-so-each-shows-category/23024>\
**Category:** Help with WordPress\
**Created:** [July 6, 2014, 1:21am UTC](https://www.phphelp.com/t/3-blog-list-pages-on-1-side-need-help-modifying-so-each-shows-category/23024 "2014-07-06T01:21:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://www.phphelp.com/uploads/default/original/2X/2/243e9ed5d93c5653ce3186f18df16e019ce38445.png) [@system](https://www.phphelp.com/u/system)\
**Post date:** [July 6, 2014, 1:21am UTC](https://www.phphelp.com/t/3-blog-list-pages-on-1-side-need-help-modifying-so-each-shows-category/23024/1 "2014-07-06T01:21:44Z")

</div>

Hi  
I had someone help me with a wordpress blog and now they’ve disappeared after a week.  
The site has 3 blog list pages, and he made the code so that all categories tagged as Press would go to the Press page, and everything else goes to a military page. But there is a third page. I was hoping to find out how to modify this code so that I can add code that if the category is “information” it goes to the information page.  
The code is below

[code]/\*\*

- do another filter, page “Press” only display the posts which category under “press”
- and page “Hero Military” display all the posts but exclude the category “press”
- 

\*/  
// get category “press”  
$category\_name = ‘press’;  
$theCategory = get\_term\_by(‘name’, $category\_name, ‘category’);

$page\_is = get\_post\_meta(get\_the\_ID(), ‘page\_is’, true);  
if ( $page\_is == ‘press’ ) {  
// “press” page only display the posts which category under “press”

if ( $theCategory ) {  
$baseARGS[‘cat’] = $theCategory -\> term\_id;  
}  
} else {  
// “Hero Military” page display all the posts but exclude the category “press”

if ( $theCategory ) {  
$baseARGS[‘category\_\_not\_in’] = $theCategory -\> term\_id;  
}  
}

if ( isset($\_POST[‘action’]) && $\_POST[‘action’] == ‘get\_posts’ ) {  
require\_once ‘config.theme.php’;  
require ‘ajax/ajax\_get\_blog.php’;  
}  
[/code]

---

<div class="post-metadata">

**Author:** ![Valkrider](https://www.phphelp.com/user_avatar/www.phphelp.com/valkrider/32/775_2.png) [@Valkrider](https://www.phphelp.com/u/Valkrider)\
**Post date:** [July 6, 2014, 5:50am UTC](https://www.phphelp.com/t/3-blog-list-pages-on-1-side-need-help-modifying-so-each-shows-category/23024/2 "2014-07-06T05:50:45Z")

</div>

Sorry need to rethink my answer so deleted.
