WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] the_posts -- "mysql_num_rows" equivalent? (3 posts)

  1. RyanPrentiss
    Member
    Posted 3 years ago #

    Hello... I'm relatively new to theme writing but have been writing in CF and PHP for many years. I need to know if "the_post" returns a value for the total number of queried records (aka mysql_num_rows) AND if it possibly returns its current position value in the loop?

    If any of these are possible, please provide. If not, please provide a work around.

  2. hedronist
    Member
    Posted 3 years ago #

    Much of what you are looking for is available via the globals $wp_query and $wpdb (which is lower level).

    Take a look at http://codex.wordpress.org/Function_Reference/WP_Query and http://codex.wordpress.org/Function_Reference/wpdb_Class. For example, $wp_query->current_post is (while in the_loop()) the index of the current post. Etc. etc.

  3. RyanPrentiss
    Member
    Posted 3 years ago #

    @hedronist... Thank you

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.