K2 Hook Up

The K2 theme provides a number of additional hooks into the template. If you’re handy with PHP you can easily add any manner of arbitrary content to these 7 regions. For everyone else, there is K2 Hook Up.

This plugin provides an options screen with each unique hook exposed as a simple text box. Insert any HTML, CSS, or JavaScript that you like, and click submit and it will be instantly published to that region of your template.

Download K2 Hook Up Plugin

Which Hooks are available?

Body Top
Right after the opening <body> tag
Before Header
between the <div id=”page”> and <div id=”header”> blocks
Header
Below the <p class=”description”> block
Header Menu
Inside the <ul class=”menu”> block. Use this one to add <li> items to your navigation
Before Content
Before all of the content in <div class=”content”> (this includes the sidebars)
After Content
After all of the content in <div class=”content”>
Before Footer
Before the start of the <div id=”footer”> block
Footer
Inside the <div id=”footer”> block, before the powered by links

For more info, and to see how the hooks are integrated into the mark up, check out the K2 CSS and Custom CSS wiki.

Hello There! Thank you for visiting my site.

This is the professional blog of Eric Marden, a veteran web developer, entrepreneur, and inspirational speaker.

If you're new here, please subscribe to my RSS feed. You'll get a blend of tech news, analysis, inspirational essays, and much more. Subscribe today.

22 Responses to “K2 Hook Up”


  • Using WordPress 2.6.3. and K2 RC-7

    I keep getting:
    Warning: call_user_func_array() [function.call-user-func-array]: First argumented is expected to be a valid callback, ‘flaresmith_load_translation’ was given in /home/fruity/public_html/wp-includes/plugin.php on line 311

  • Addendum to previous comment… I am also using FeedBurner FeedSmith plugin. Maybe there’s a conflict with it?

  • I activated your plugin and got this:
    Warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, ‘flaresmith_load_translation’ was given in /home/twenty/public_html/wp-includes/plugin.php on line 311

    I am very eager to start using this, it is exactly what I have been looking for!

  • fruityoaty,

    That’ll teach me to copy code from another plugin! I just committed a fix for this as v0.6. Upgrade to that, and you’ll be fine. It should happen semi-automatically since you’re using WP 2.6.3.

    Thanks for pointing that out!

    - Eric Marden

  • Thanks for the quick fix. Works great.

    Wow, I must say… this is a great plugin. Having fun trying it out. Thank you very much for sharing your work.

  • My pleasure. Have fun, and spread the word. K2 is love.

    -e

  • Eric. Interesting plugin you got here. I am thinking about all sorts of possibilities with this. So far, I am enjoying my experience with K2. Keep up the great work!

  • Thanks, Bensan.

    I’m going to be adding php support to K2 Hook Up later today, which will further blow the doors off this great theme.

    I have another plugin I’m starting to draw up plans for, that will require being able to print out WordPress template tags in the hooks that this plugin targets, so the two will go hand in hand once they are both finished.

    Stay tuned,

    - Eric

  • v1.0 of K2 Hook UP now supports inserting PHP code. You can read more about this update on the blog.

  • How do you get rid of the 2 post titles that show up above and/or below the single post entries without screwing anything up? Is it in the single.php file?

  • I just installed.. wow.. thanks!

  • Ryan,

    You’ll have to link me to a page this is happening on so I can see what you’re doing. Nothing in my plugin should be causing double titles.

    -e

  • David,

    You’re welcome. I think K2 Hook Up makes K2 an even smarter choice in themes for WordPress.

    -e

  • Eric,

    I’m not talking about double titles, I’m referring to the titles that link to other posts and appear in smaller font above the single page titles

  • You can do that with CSS. Put this in your custom style sheet:


    .nav-previous, .nav-next {
    display: none;
    }

    This will just hide the links. You can also target the id: #nav-above and #nav-below and hide the whole containing box too.

    Let me know if you need more help than that.

    -e

  • Eric,

    That’s exactly what I needed. Thanks for the help.

  • Hello Eric, I would like to wrap some of my sidebar widgets into divs for css styling – is there a wp or k2 hook that I can use?

    (I am currently hacking k2.php to get it done but I would like to use a functions.php file in my k2 style’s directory instead)

  • Btree,

    I can’t think of any hooks that would be useful in this regard, but there still may be a solution. The sidebars are wrapped in divs that can be styled pretty easily. What are you trying to do that you need more divs for?

    -e

  • btree:

    You would use the filter “dynamic_sidebar_params”.

  • Hi there,

    I’m using WordPress 2.7 and K2 RC-7 and it works beautifully. I’ve been looking for something like this for a while. I’ve already started to ‘pimp up’ my website with your plugin. Amazing work by the way! I’m amazed I can now tweak my themes without worrying about the upgrade to a new K2 or a new wordpress. Cheers and keep up the good work!

  • Is is possible to add edit in place via flutter plugin with the k2 hooks plugin? I need to add : <h2 class=”"> And :
    <div class=”">

    to theLoop.php i think…

Leave a Reply