Title: PostsByCategory hack not working
Last modified: August 18, 2016

---

# PostsByCategory hack not working

 *  [mage111](https://wordpress.org/support/users/mage111/)
 * (@mage111)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/postsbycategory-hack-not-working/)
 * i’ve been attempting to get this hack:
    [http://wiki.wordpress.org/index.php/PostsByCategory](http://wiki.wordpress.org/index.php/PostsByCategory)
   working for the past hour everything the author has told to do, ive done. my 
   index page includes: <?php require_once(‘c_gen.php’);?> as well as <?php require_once(‘
   c_stuff.php’);?> so 2 seperate categories should be posting _C\_GEN.PHP_ <?php
   $cat=’1′; $blog=’1′; require_once(‘wp-blog-header.php’); ?> <?php get_archives(‘
   monthly’, ”, ‘link’); ?> _<b>Meaningful?</b>_ <?php if ($posts) { foreach ($posts
   as $post) { start_wp(); ?> <div id=”title”> <?php the_title(‘[‘,’]’); ?><div 
   id=”date”><?php the_time(”); ?></div></div> <div id=”content”><?php the_content();
   the_author_firstname(); ?> </div> <?php } } else { ?> <?php } ?> _C\_STUFF.PHP_
   <?php $cat=2′; $blog=’1′; require_once(‘wp-blog-header.php’); ?> <?php get_archives(‘
   monthly’, ”, ‘link’); ?> _<b>Meaningful?</b>_ <?php if ($posts) { foreach ($posts
   as $post) { start_wp(); ?> <div id=”title”> <?php the_title(‘[‘,’]’); ?><div 
   id=”date”><?php the_time(”); ?></div></div> <div id=”content”><?php the_content();
   the_author_firstname(); ?> </div> <?php } } else { ?> <?php } ?> Each page seems
   to contain the correct code for it to work. But what happens is, the category
   choice for the latter of the 2 php include links, is applied. so the first php
   include really has no effect other than parsing a template page. so i recieve
   identical postings on either side of my page this is the code i’ve used for index
   page, where the php is being included. <div id=”blog”> <div id=”column2″> <?php
   require_once(‘c_stuff.php’);?> </div> <div id=”column”> <?php require_once(‘c_gen.
   php’);?> </div> </div> PS. i’ve tried varitions of include, include_once, as 
   well as require. i have practically no knowledge of php, so if my syntax is off
   i wouldnt know, but i dont think its wrong. any help would be most appreciated.
   Thanks

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

 *  [Cena (a11n)](https://wordpress.org/support/users/cena/)
 * (@cena)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/postsbycategory-hack-not-working/#post-42695)
 * It could be a matter of your using a version of WP not compatible with this hack,
   but the author doesn’t seem to specify which version(s) are compatible. (Nor 
   do you mention what version you’re using. :))
    At any rate, it might be better
   to just contact him directly
 *  Thread Starter [mage111](https://wordpress.org/support/users/mage111/)
 * (@mage111)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/postsbycategory-hack-not-working/#post-42702)
 * ah, my bad – im using the latest nightly build.
    and the closest thing to compatibility
   the author specifies is: 1.0+ i believe. but yeah – i may just go ahead and do
   that, kinda thought about it – but i didnt feel like personally bugging him over
   it. Thanks anyways Cena – i’ll give it a day or so maybe someone will still have
   a solution. or may prompt a solution/work around Peace
 *  Thread Starter [mage111](https://wordpress.org/support/users/mage111/)
 * (@mage111)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/postsbycategory-hack-not-working/#post-42720)
 * well i just sent an email to the address listed on the wiki page, and it would
   seem its a bunk address, so now i guess i have to rely on the support of the 
   forums.
 *  Thread Starter [mage111](https://wordpress.org/support/users/mage111/)
 * (@mage111)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/postsbycategory-hack-not-working/#post-42830)
 * any support here?
    This is becoming quite a headache, what em i supposed to do,
   downgrade?…
 *  [martin](https://wordpress.org/support/users/martin/)
 * (@martin)
 * [22 years, 1 month ago](https://wordpress.org/support/topic/postsbycategory-hack-not-working/#post-43094)
 * Same suffering here… I have the same problem. I’m desperately looking for help.
 *  Anonymous
 * [22 years ago](https://wordpress.org/support/topic/postsbycategory-hack-not-working/#post-43464)
 * I’ve been working on this for a while now, I can’t figure out any PHP workarounds,
   but I’ve found that the whole problem can be skipped by putting the second category
   in an iframe, it’s not as efficient, but it works and it’s easy.
 *  [cLin](https://wordpress.org/support/users/clin/)
 * (@clin)
 * [22 years ago](https://wordpress.org/support/topic/postsbycategory-hack-not-working/#post-43466)
 * I am having this problem also, using the newest version of WP and when I see 
   the page, it’s the exact same posts on both sides, even if I did specify which
   cats to show from. Anyone know how to fix without an iframe?

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

The topic ‘PostsByCategory hack not working’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 5 participants
 * Last reply from: [cLin](https://wordpress.org/support/users/clin/)
 * Last activity: [22 years ago](https://wordpress.org/support/topic/postsbycategory-hack-not-working/#post-43466)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
