Support » Plugins and Hacks » Need Help with Hacks

  • Hi, I tried to use the show one category on the index page hack. I copied the data directly from the wiki page, but I’m getting an error. This is my first attempted hack. Help?
    http://www.moltenwords.net
    Here’s the error i got:
    Warning: Unexpected character in input: ‘\’ (ASCII=92) state=1 in /home/moltenwo/public_html/my-hacks.php on line 3
    Parse error: parse error in /home/moltenwo/public_html/my-hacks.php on line 3

Viewing 9 replies - 1 through 9 (of 9 total)
  • if (‘/’ == $_SERVER[‘REQUEST_URI’])
    is the hack.
    Is yours the wrong way round ?

    No, I copied and pasted it directly from the wiki.

    I don’t use this hack, but I’d try using a / instead ? Just to see what happens ?
    (I know it sounds daft, but comparing error messages sometimes helps ?)

    oops. I meant \

    Thanks, I’ll try that as soon as my server starts working again. grr…

    Well I don’t know what the deal was, but I erased the ‘/’ and retyped it and now it works. Frickin’ computers!

    Excellent 🙂

    I tried creating a my-hacks.php with the code as listed in the Wiki. After enabling hacks in my WP options, my blog disappears — a totally blank page. If I disable hacks in WP options, the blog comes back.
    I also tried several permutations on this, as found here:
    http://wordpress.org/support/3/2954
    When I try this, I _only_ get the category I define in my-hacks.php. Worse still is that index.php?c=7 (a non-front-page category) shows the latest post in the general category!
    I tried putting the if clause into my index.php instead of in my-hacks.php, but that doesn’t work _either_.
    Pointers are greatly appreciated.

    I tried the code in the Wiki, but it didn’t do anything for me.
    So I replaced it with this:
    // This bit forces the default category to be category 1
    if (!isset($cat) && !isset($p))
    $cat = 1;
    if (isset($s))
    $cat = ''; // so searches work on all categories

    This works, except the archive is screwed up (only archive that is visible is the current category). I haven’t started working on that bug yet…

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Need Help with Hacks’ is closed to new replies.