WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] How to implement "hook"? (2 posts)

  1. sailormarcus
    Member
    Posted 6 years ago #

    http://wphooks.flatearth.org/hooks/category_link/

    This "hook" is exactly the function I need, but I have a hard time figuring out how I should use it. I bet it's really easy, but I want to confirm it before I start doing weird stuff to my dear WP!

    so, 1) Should I create that file (from that page) called template-functions-category.php in the plug-in directory or in the wp-includes folder ?

    2) How would I implement it on my blog, with
    add_filter('category_link')?
    I would like it to show on my frontpage listing of articles, does that mean I will have to do something like

    <?php
    $cat = get_the_category();
    $cat = $cat[0];
    echo $cat->category_link ;
    ?>">

    to call it?

    Any help whatsoever would be MUCH MUCH appreciated!

  2. sailormarcus
    Member
    Posted 6 years ago #

    d'uh, never mind me, I was just being stupid, realized it was 100 times easier using get_category_link, I have no idea how I could miss that. sorry!

Topic Closed

This topic has been closed to new replies.

About this Topic