Search

שיפור ביצועים של הפונקציות wp_query ו query_posts

שימו לב להערות בקוד! לדוגמה, במידה ונחוץ עימוד ממוספר(Pagination) אין להשתמש ב no_found_rows=true.

$args = array(
	// Normal query arguments goes here //
	'no_found_rows' => true, // counts posts, remove if pagination required
	'update_post_term_cache' => false, // grabs terms, remove if terms required (category, tag...)
	'update_post_meta_cache' => false, // grabs post meta, remove if post meta required
);
$loop = new WP_Query( $args );

למידע נוסף בקרו במאמר הבא.

מצאתם טעות בקוד? הסניפט לא עובד לכם? רישמו לי בתגובות ואני מבטיח לטפל בכך במהרה ולספק סניפט תקין...
0 תגובות...

תגובה חדשה

Up!
לבלוג