echo get_post_meta of all post in a category to fill up a select field

Thank you very much for your answers! I finally found what I wanted here : http://sixrevisions.com/wordpress/custom-fields-search/ Here is the code : <form name=”search” action=”” method=”get”> <select name=”City”> <?php $metakey = ‘city’; $cities = $wpdb->get_col($wpdb->prepare(“SELECT DISTINCT meta_value FROM $wpdb->postmeta WHERE meta_key = %s ORDER BY meta_value ASC”, $metakey) ); if ($cities) { foreach ($cities as $city) … Read more

List only categories i specify

@Kevin is right. You can create any number of menus in Appearance -> Menus Just create a new menu for your categories. Lets call it categories. You can call this menu in your theme using this code. <?php wp_nav_menu( array(‘menu’ => ‘categories’ )); ?>

Get paged category link programmatically

This the code I have so far which looks like it does the job, I still wonder if there is a API function for the job: /** * @param (int) $category_id * @param (int) $pagenum * @return string */ function get_category_paged_link($category_id, $pagenum) { global $wp_rewrite; $link = get_category_link($category_id); if ($wp_rewrite->using_permalinks() || $wp_rewrite->using_index_permalinks()) { $link = … Read more

Recent post by custom select query

The function you have posted uses a nasty custom SQL query which is really not necessary and adding a category filter to it would make it even worse, you can do all of the filters using WP_Query object or get_posts except the exclusion of password protected posts which can be done with a simple function … Read more