Support » 外掛 » 誰可以教Related Posts Thumbnails這套件我怎麼更改排列順序?(我不想照ID排)

  • 我想要related posts在我網站上不要照ID牌而是照日期排,而且也要顯示該文章在清單中(就是完整的該分類文章清單在每個文章頁),不知道要怎麼寫?我不是coder 🙁
    相關code在這:

    $order = " ORDER BY rand() LIMIT " . $posts_number;
    		$random_posts = $wpdb->get_results( $query . $join . $where . $order );
    
    		/* Get posts by their IDs */
    		if ( !is_array( $random_posts ) || count( $random_posts ) < 1 ) {
    			return $this->finish_process( $output, $debug . 'No posts matching relationships criteria;', $time );
    		}
    
    		$posts_in = array();
    		foreach ($random_posts as $random_post)
    			$posts_in[] = $random_post->ID;
    		$query = "SELECT ID, post_content, post_excerpt, post_title FROM $wpdb->posts WHERE ID IN ('". implode( "', '", $posts_in ) . "')";
    		$posts = $wpdb->get_results( $query );
    		if ( ! ( is_array( $posts ) && count( $posts ) > 0 ) ) { // no posts
    			$debug .= 'No posts found;';
    			return $this->finish_process( $output, $debug, $time );
    		}
    		else
    			$debug .= 'Found ' . count( $posts ) . ' posts;';

    希望有人能指點迷津,我完全不知從何改起…

  • The topic ‘誰可以教Related Posts Thumbnails這套件我怎麼更改排列順序?(我不想照ID排)’ is closed to new replies.