Support » Fixing WordPress » HELP! Show-one-category-on-front-page hack

  • I’ve been trying to implement the Show-one-category-on-front-page hack on my site. I’ve followed the instructions outlined in the Wiki by adding lines to myhacks.php and changing to “posts paged” in my options section, but nothing happens! It simply still lists all of the posts in all of the categories when you go to, just as before. There’s not even an error message so that I can try to figure it out on my own. Has anyone else had this problem before?

Viewing 7 replies - 1 through 7 (of 7 total)
  • it’s my-hacks.php
    Is that the reason why?, I wonder.

    naw… just accidentally left out the – 😀
    everything else in the my-hacks.php file works.

    if ('/' == $_SERVER['REQUEST_URI'] || '/index.php' == $_SERVER['REQUEST_URI'])
    $cat = 1;
    // Switcher
    // Mood
    // people popup
    function peopleDefine($text) {
    global $wpdb;
    $names = $wpdb->get_results("SELECT people_ID, people_name, people_bio FROM wp_people");
    <script language="JavaScript" type="text/javascript">
    function peoplePop(id){
    peopleURL = 'wp-people-popup.php?person=' + id; (peopleURL, 'peopleWin', 'toolbar=no,location=no,menubar=no,status=no,scrollbars=yes,status=no,width=350,height=350');
    function myVoid(){

    foreach ($names as $names) {
    $thisID = $names->people_ID;
    $searchArray = array('\'','\"');
    $replaceArray = array('&lsquo;','&quot;');
    $real_name = $names->people_name;
    $text = preg_replace("#$real_name(?!</(ac|sp))#",
    "$real_name", $text, 1);
    $text = preg_replace("#$real_name(?!</(ac|sp))#",
    "<span class=\"caps\"'>$real_name</span>", $text);
    return $text;
    add_filter('the_content', 'peopleDefine');

    this does not use my-hacks.php at all, so might be useful.

    sweet!!! thanks a TON!!!

    hmm…. dammit. while that does prevent any other than the specified category to show on the main page… it also keeps you from EVER getting to them. WTF?????

    Where are y’all finding
    ‘/* Don’t remove these lines. */
    $blog = 1;
    $cat = 1;’
    at? My first three lines look like:
    /* Don't remove this line. */
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
    <html xmlns="">
    <head profile="">
    <title><?php bloginfo('name'); ?><?php wp_title(); ?></title>

    Nevermind, I got it to work.
    I got rid of the line:
    if ('/' == $_SERVER['REQUEST_URI'] || '/index.php' == $_SERVER['REQUEST_URI'])

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘HELP! Show-one-category-on-front-page hack’ is closed to new replies.