BP_Blogs_Template::blogs()

Whether there are blogs left in the loop to iterate over.

Description

This method is used by bp_blogs() as part of the while loop that controls iteration inside the blogs loop, eg: while ( bp_blogs() ) { …

See also

Return

(bool) True if there are more blogs to show, otherwise false.

Source

File: bp-blogs/classes/class-bp-blogs-template.php

	public function blogs() {
		if ( ( $this->current_blog + 1 ) < $this->blog_count ) {
			return true;
		} elseif ( ( $this->current_blog + 1 ) === $this->blog_count ) {

			/**
			 * Fires right before the rewinding of blogs listing after all are shown.
			 *
			 * @since BuddyPress 1.5.0
			 */
			do_action( 'blog_loop_end' );
			// Do some cleaning up after the loop.
			$this->rewind_blogs();
		}

		$this->in_the_loop = false;
		return false;
	}

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.