WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Using Too Many MySql Queries (3 posts)

  1. Nasir Zia
    Member
    Posted 2 years ago #

    Hi,
    I have been asked to include certain features like adding badges and custom filtered information on homepage... I have used for about 5,6 MySql Queries to sort the issue..
    Even though i have achieved the desired target, but just want to make sure that if its ok to use custom queries, or using too many of them will slow down the site?
    Thanks

  2. keesiemeijer
    moderator
    Posted 2 years ago #

    It's ok to use 5 or 6 custom queries in a template file. But less queries is always better. If you're also querying the main loop you should alter the loop with the pre_get_posts hook: http://developer.wordpress.com/2012/05/14/querying-posts-without-query_posts/

  3. Nasir Zia
    Member
    Posted 2 years ago #

    Hi Keesiemeijer,
    i had to create a personalized home page for every logged in user which will display all the posts which are NOT rated by that user (GD Star rating is the rating plugin).
    For that i had to write some custom queries to achieve the desired feature..
    Thanks for the clarification :)

Topic Closed

This topic has been closed to new replies.

About this Topic