WordPress.org

Ready to get started?Download WordPress

Forums

Based On Post
[resolved] Need a template tage for the widget please (6 posts)

  1. houseofstrauss
    Member
    Posted 2 years ago #

    I want to place this widget in my template, so I need the php function to add please.

    Thank-you.

    http://wordpress.org/extend/plugins/based-on-post/

  2. MelvinSoftware
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for the Request. I've just updated the plugin so that there is a Template Tag available now.

    Add this to one of your PHP files in the location that you want the data to show.

    <?php msbop_template_tag(); ?>

  3. houseofstrauss
    Member
    Posted 2 years ago #

    Thank-you very much for adding this in. Can I politely suggest you use

    <?php
    if (function_exists('FUNCTION NAME')) {
     FUNCTION_NAME();
    }
    ?>
    As this prevents errors if the plugin is deactivated

    re http://codex.wordpress.org/Managing_Plugins#Theme_Changes

  4. MelvinSoftware
    Member
    Plugin Author

    Posted 2 years ago #

    Thank you For the Tip, houseofstrauss,

    I did a bit of research on my own on this, and discovered that as an alternative, using Hooks seemed an even better (cleaner) way to do this. I updated the Plugin (though the update was so small I didn't update the version number). As a result, you can use the following code in your template instead:

    <?php do_action( 'msbop_template_tag' ); ?>

  5. houseofstrauss
    Member
    Posted 2 years ago #

    Great! thanks for going further on that.

  6. MelvinSoftware
    Member
    Plugin Author

    Posted 2 years ago #

    You're very welcome!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic