WordPress.org

Ready to get started?Download WordPress

Forums

Execute brackets [] tags in theme files? (2 posts)

  1. object81
    Member
    Posted 6 years ago #

    I try to use the plug-in multifeedsnap to leech content via RSS to my blog. But I have trouble getting this plug-in to work outside of a post or a page, since I only know the code with brackets. My header.php doesn't know what to do with this brackets so it's just displayed as text.

    According to the documentation I should use:

    [feedsnap, 8]feedurl[/feedsnap]

    Then I thought it would be possible to use

    <?php
    if (function_exists('multifeedsnap_function'))
    { multifeedsnap_function("[feedsnap, 4]http://wordpress.com/tag/hot-blogger-bracket/feed/[/feedsnap]"); }
    ?>

    to activate the plug-in in my header. But it doesn't work. Any thoughts?

  2. Dr C
    Member
    Posted 5 years ago #

    Hey object81,
    Just saw this now. MFS uses the WP hook as follows (line 154 of MFS code):

    add_filter('the_content','multifeedsnap_function');

    This means that the MFS brackets are only processed when WP is about to display 'the_content'. If yoiu check out the filter/hooks references you might find one that suits your needs. I had a quick look but couldn't find one that was obvious.

    When you find one that suits you, replace the 'the_content' part of line 154 above with your preferred hook, and it *should* work like a dream :)

Topic Closed

This topic has been closed to new replies.

About this Topic