my-hacks.php file (7 posts)

  1. Anonymous
    Posted 12 years ago #

    I've created a my-hacks.php file however, only one of my hacks works. the first one. after that, if I add any, it doesn't work.
    aren't you supposed to put the codes between < >?
    are you supposed to creat a new < > each time you add a hack? how does it work?

  2. NuclearMoose
    Posted 12 years ago #

    You need only one set of opening and closing PHP tags. Ensure that there are no returns or spaces or anything after the closing tag.

  3. Anonymous
    Posted 12 years ago #

    Yeah I checked that too. Only the first set of codes work.
    Should I put a code and then no space and more code or space between the codes?

  4. Mark (podz)
    Support Maven
    Posted 12 years ago #

    Here's an old 'my-hacks.php' that I used to use:
    <?php require_once('hacks/wp-grins.php'); ?>
    <?php require_once('hacks/days_since.php'); ?>
    <?php require_once('hacks/days_to.php'); ?>
    <?php require_once('hacks/get_comment_count.php'); ?>
    <?php require_once('hacks/get_comment_word_count.php'); ?>
    <?php require_once('hacks/get_most_commented.php'); ?>
    <?php require_once('hacks/get_post_count.php'); ?>
    <?php require_once('hacks/get_post_word_count.php'); ?>
    <?php require_once('hacks/get_recent_posts.php'); ?>
    <?php require_once('hacks/comment_plugger.php'); ?>

    Bear in mind that I had put all the hacks into a folder called 'hacks' which was in the wordpress directory.

  5. Anonymous
    Posted 12 years ago #

    Thanks so much padz. Just one more question, in WP directory there is a folder called "plugins" is that same or should i create another thats called "hacks"?

  6. Mark (podz)
    Support Maven
    Posted 12 years ago #

    Strictly speaking they are not the same.
    I literaly do keep my plugins in 'plugins' and the 2 hacks I have in 'hacks' - keeps it all nice and neat :)

  7. Anonymous
    Posted 12 years ago #

    Ok thanks a lot!!!

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.