How many queries are normal to execute on a WP site?

I wouldn’t say it’s not “normal”, but it’s above typical. The common minimum of queries would go like: main query (set of posts) functionality (menus, widgets, etc) data (terms and such) On a WP test data that would make something under 50 queries on home page. With object cache it will fall under 10 on … Read more

WordPress cache a menu with Transient API

wp_nav_menu() doesn’t return anything by default, it just echoes out formatted html. For wp_nav_menu() to return a value you will need to pass ‘echo’ => false into it’s arguments, like so: $housemenu = wp_nav_menu( array( ‘menu’ => ”, ‘menu_class’ => ‘sf-menu’, ‘menu_id’ => ‘nav’, ‘walker’ => new description_walker(), ‘echo’ => ‘false’ )); It should be … Read more

How many caching plugins should be used?

@Tal, Generally speaking you should only be using one caching plugin. WP Super Cache, W3 Total Cache, Hyper Cache and DB Cache Reloaded all drop files directly in your wp-content directory and they would conflict with each other and cause errors if you were using more than one. I would recommend using W3 Total Cache … Read more

Cache Get_posts

You can use transient cache to cache your custom query. Here is a simple code to set_transient cache for your query for 12 hours. In 12 hours WordPress will not make new query but fetch posts from transient. On expiration, it will save new query in transient again for next 12 hours. I have been … Read more

posts_per_page doesnt work

Yeah, use ‘nopaging’ => true http://codex.wordpress.org/Class_Reference/WP_Query#Pagination_Parameters $Poz = array( ‘posts_per_page’ => 3, ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘update_post_term_cache’ => false, ‘update_post_meta_cache’ => false, ‘nopaging’ => true, ); $the_query = new WP_Query( $Poz );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)