WordPress.org

Support

Support » Plugins and Hacks » Related Posts Thumbnails » [Plugin: Related Posts Thumbnails] Setting different amount of posts for two get_related_posts_thumb

[Plugin: Related Posts Thumbnails] Setting different amount of posts for two get_related_posts_thumb

Viewing 1 replies (of 1 total)
  • Hey, a little late, but as I needed the same today, I modified the plugin a bit and will probably serve for someone in the future:

    Edit related-posts-thumbnails.php file

    Search for global $wpdb; (around line #90), and before that line add:

    if (!empty($this->options)) {
    	foreach ($this->options as $option => $value) {
    		$$option = $value;
    	}
    }

    Then, search for function get_related_posts_thumbnails() (around line 830) and modify it to look like this:

    function get_related_posts_thumbnails( $options = false )

    And two lines below (right after global $related_posts_thumbnails;), add this:

    if (!empty($options)) {
    	$related_posts_thumbnails->options = $options;
    }

    And that’s it!

    Now, you can overwrite any admin option on the call:

    Want to show 5 related posts?

    <?php get_related_posts_thumbnails(array('posts_number' => 5 )); ?>

    Again, I can send diff files to the developer or anyone who ask for them.

    Have a great day!
    Gaston Gorosterrazu

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: Related Posts Thumbnails] Setting different amount of posts for two get_related_posts_thumb’ is closed to new replies.
Skip to toolbar