WordPress.org

Forums

[Plugin: K2 Hook Up] Inclusion of PHP code (13 posts)

  1. Robert S
    Member
    Posted 6 years ago #

    Hi,

    My blog is based on the K2 theme and I was very excited to stumble across your plugin. I am starting to do more and more customisations and your plugin is going to come in very handy.

    I await a future release that will allow for inclusion of PHP code in the snippet.

    Regards,

    R

    http://wordpress.org/extend/plugins/k2-hook-up/

  2. Eric Marden
    Member
    Posted 6 years ago #

    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/

  3. Robert S
    Member
    Posted 6 years ago #

    Hi Eric,

    Thanks for your prompt response.

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

    R

  4. Eric Marden
    Member
    Posted 6 years ago #

    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/

  5. Robert S
    Member
    Posted 6 years ago #

    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

  6. Eric Marden
    Member
    Posted 6 years ago #

    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

  7. Robert S
    Member
    Posted 6 years ago #

    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

  8. Eric Marden
    Member
    Posted 6 years ago #

    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

  9. Robert S
    Member
    Posted 6 years ago #

    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

  10. Eric Marden
    Member
    Posted 6 years ago #

    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

  11. nbseminary
    Member
    Posted 6 years ago #

    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

  12. danieldickey
    Member
    Posted 5 years ago #

    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

  13. Eric Marden
    Member
    Posted 5 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags