WordPress.org

Ready to get started?Download WordPress

Forums

Yet Another Related Posts Plugin (YARPP)
[resolved] orderby error (3 posts)

  1. dawnwire
    Member
    Posted 1 year ago #

    I've been debugging my theme and keep getting this error for my results:

    Notice: Undefined index: orderby in /mysite/www/wp-content/plugins/yet-another-related-posts-plugin/class-cache.php on line 122

    Here's what I'm using. Order is the default score but I've tried other parameters getting the same error. I don't use the default category or post_tag, so I've had to explicitly state my new taxonomies in the arguments below.

    yarpp_related(array(
    				            'post_type' => array('column','video','cartoon'),
    				            'template' => 'yarpp-template-riotwire-vertical-thumbs.php', 
    
    				             'require_tax' => array(
                                      'topic' => 0 //is this correct?
                                  ),
    				              'weight' => array(
                                         'body' => 1,
                                         'title' => 2, // larger weights mean this criteria will be weighted more heavily
                                         'tax' => array(
                                            'location' => 1,
                                            'topic' => 4,
                                            'issue' => 3,
                                          )
                                  ),
                                  'threshold' => 1,   // The threshold which must be met by the "match score"
    				             'limit' => 3,
    				             'order' => 'score DESC'
    
    				            )
    				      );
               }

    http://wordpress.org/extend/plugins/yet-another-related-posts-plugin/

  2. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for reporting this here. It's not immediately obvious that there would be any problem with the code you posted here, so I'll try running it myself to investigate. Thanks!

  3. mitcho (Michael Yoshitaka Erlewine)
    Member
    Plugin Author

    Posted 1 year ago #

    I just touched up the code to try to be more robust against different input to the API. Please see if this new version helps your situation.

    http://downloads.wordpress.org/plugin/yet-another-related-posts-plugin.4.0.7b1.zip

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic