Add 2 values to post__not_in

This should display 5 posts per page (-1 for all of them on one page), with the post ID’s $value1 and $value2 being ignored. Ensure $value1 and $value2 are integers. $args = array( ‘numberposts’ => 5, ‘posts_per_page’ => get_option(‘posts_per_page’), ‘paged’ => $paged, ‘post__not_in’ => array( $value1, $value2 ) ); query_posts($args); EDIT – With the further … Read more

Get custom post fields from multiple metaboxes

If I understand your question correctly, you would like to get all metadata for “products” across all posts. In other words, multiple posts have metadata with key “products” and you want to get those values. If this is correct, you should use get_post_custom_values, which is well documented in the codex: http://codex.wordpress.org/Function_Reference/get_post_custom_values. As a side note, … Read more

How to randomise my menu items?

Ehm, afaik the return value of the menu fn is an object: You need to type cast earlier $menu_items = (array) wp_get_nav_menu_items( 26 ); // Typecast here $menu_items = array_rand( $menu_items, 3 ); foreach ( $menu_items as $key => $menu_item ) { echo $menu_item[‘title’]; }

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