Not signed in (Sign In)

Vanilla 1.1.4 is a product of Lussumo. More Information: Documentation, Community Support.

Welcome Guest!
Want to take part in these discussions? If you have an account, sign in now.
If you don't have an account, apply for one now.
    • CommentAuthorLarsLB
    • CommentTimeAug 14th 2007 edited
     
    Hello there,
    first of all .. Tarski rocks .. clean, simple, gorgeous ..

    2nd ..
    I've just installed the Similar Posts plugin which suggests to add "<ul><?php similar_posts(); ?></ul>" at the place in your template where you want the list of related posts to appear.

    I'd like to place it right here:
    $postEndInclude

    however .. when I post the above code between <<<PAGEENDINCLUDE and PAGEENDINCLUDE;
    nothing appears .. if I just try text in between those two.. no problem .

    I'm not really knowledgeable when it comes to php so I'm guessing there's a simple solution to the problem.
    also tried to learn more by reading about heredoc but that confuses me even more ..

    any help is highly appreciated and will bring you good karma :) ..

    thank you,
    Lars
  1.  
    Well, the basic problem is that you're trying to include PHP delimiters between already existing ones. The constants.php methodology is not really the way I'd recommend to do what you want; a better way would be to create a plugin to interface with Tarski's hooks. Copy this code into a text file and save it in your plugins directory as tarski-similar-posts.php (or whatever).

    <?php /*
    Plugin Name: Similar Posts in Tarski
    Plugin URI: http://tarskitheme.com/
    Description: Displays similar posts in Tarski
    Author: Ben Eastaugh
    Version: 1.0
    Author URI: http://extralogical.net/
    */
    function tarski_output_similarposts() {
    if(is_single()) {
    echo "<ul>\n";
    similar_posts();
    echo '</ul>'."\n";
    }
    }
    if(function_exists('similar_posts')) {
    add_action('th_postend','tarski_output_similarposts');
    }
    ?>
    • CommentAuthorLarsLB
    • CommentTimeAug 15th 2007
     
    "interface with Tarski’s hooks" ..
    what does this mean exactly?

    how would I call this plugin / or how would this plugin know where to post the similar posts?
    meaning. .do I need to put anything in the constants.php after I created this plugin?

    thank you so much for your help ..
    Lars Behrenroth
  2.  

    Nope, just install the plugin. As long as you also have the Similar Posts plugin (that’s what the function_exists(‘similar_posts’) call is for) it should work automatically. Let me know if you have any problems.

    If you really want to know the technical details, have a read through this article.