WordPress.org

Support

Support » Plugins and Hacks » [Plugin: K2 Hook Up] Inclusion of PHP code

[Plugin: K2 Hook Up] Inclusion of PHP code

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thanks for your message, R Schilt. I think I know of a way to do this, and will try to add this feature soon. Keep on the look out for a future update to the plugin.

    – Eric Marden
    http://xentek.net/

    Hi Eric,

    Thanks for your prompt response.

    Are you also planning on adding some additional “hooks” to the existing seven?

    R

    Just wanted to let you know that v1.0 of the plugin now supports PHP. I don’t have any plans to add any more hooks, since that requires editing the K2 theme files, which I try not to do as that makes upgrading harder.

    Enjoy, and let me know if you run into any problems with the new version.

    – Eric Marden
    http://xentek.net/

    Eric,

    Thanks mate – good work!

    Note:

    1) Updated plugin
    2) Activated no probs.
    3) Configured K2H with some PHP code in hook “after content”
    4) Ticked the box to exec PHP code.
    5) Saved changes – OK.
    6) Ran blog and php ran OK – except in what appeared the wrong place. This hook must get triggered somewhere after The Loop and not at the point straight after the last of the “content” is displayed within The Loop.

    Any comments?

    R

    Check the K2 wiki for where the hooks are placed: http://code.google.com/p/kaytwo/wiki/K2CSSandCustomCSS

    As far as I know there aren’t any inside The Loop.

    Do you need one somewhere near the content of a post?

    -e

    Eric,

    Thanks for getting back to me.

    After I logged the previous post I did make my way to your doco and then the K2 wiki at code.google. Makes sense why your plugin is behaving the way it does… it’s doing what it’s meant to do.

    Ideally I would like to move all of code I have added to K2 templates out and into your plugin. This is what I envisaged when I 1st saw your plugin appear on the horizon. Now I’m not so sure that this is going to be practical. I have basically just added snippets of code rather than actually modified anything.

    With the test I explain in previous post – I have a bunch (essentially function calls to various plugins) of code sitting inside the loop after the content has been displayed – eg: bookmarking, signature, similar posts etc…

    If you have a look at a single post on my site you will see what I mean.

    I will understand if you don’t wish to modify your Hook plugin any further.

    Cheers bro,

    R

    You know, I can create a plugin that allows you to do this. I hesitate to add this to K2 Hook Up, since where I’d hook into WP would be coming from core, and users of other themes may find this new plugin useful.

    Let me see what I can whip up today.

    – Eric

    Hi Eric,

    There is a plugin called “Snippets” (By John Godley) which does a similar thing. I have tested this plugin on a number of occasions but could never get it to work properly – it either clashed with other plugins or I found it to difficult to use.

    Let see what you come up with.

    Regards,

    R

    Check out my new plugin and see if this doesn’t fit the bill: http://xentek.net/code/wordpress/plugins/in-the-loop/

    Thanks!

    -e

    Hi Eric,
    I am trying your In The Loop plugin as I wanted to add Lester Chan’s wp-print plugin and wp-email plugin to my posts in the K2 theme without hacking the theme. I do not seem to be getting anywhere. I entered the php code <?php if(function_exists('wp_email')) { email_link(); } ?> but got nothing. Am I doing it wrong?
    Thanks,
    Loren

    Hello Friend

    @danieldickey

    If I activate k2 hook up on my site…a different theme, will it work? If not what must I do in order to make it work? Thank you.

    DanielDickey.com

    Daniel, you will need to add the hooks manually to your new theme. They would look something like this <?php do_action('template_*'); ?>

    template_* should be replaced with the real hook names, and placed where you think they fit best:

    template_body_top
    template_before_header
    template_header
    template_header_menu
    template_primary_begin
    template_primary_end
    template_before_content
    template_after_content
    template_entry_head
    template_entry_foot
    template_before_footer
    template_footer

    Hope this helps,

    -e

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: K2 Hook Up] Inclusion of PHP code’ is closed to new replies.