• Resolved divyang.jp

    (@divyangjp)


    Hi Mitcho,
    I upgraded to WordPress version to 3.1.1 and upgraded YARPP to latest version automatically. I use custom template. I got fatal error “Call to a member function get_results() on a non-object in” my template file.

    Below is the code,

    <?php
    	$now = gmdate( "Y-m-d H:i:s", time() );
    	$request = "SELECT ID, post_title, post_excerpt FROM $wpdb->posts WHERE post_status = 'publish' AND post_password ='' AND post_type='post' AND post_date_gmt < '$now' ORDER BY post_date DESC LIMIT 0, 4";
    	$posts = $wpdb->get_results( $request );
    
    	$default_thumbnail = get_bloginfo('template_url') . '/images/default-image.jpg';

    https://www.ads-software.com/extend/plugins/yet-another-related-posts-plugin/

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Yet Another Related Posts Plugin] Call to a member function get_results() on a non-object i’ is closed to new replies.