Get tags related to wordpress category

October 13, 2009

Do you noticed there is no native way to retrieve tags based on the wordpress category. But if you want to be able to get tags related to one (or more) specific category, just insert the following function in your theme’s functions.php.   Here is the function you have to paste in your function.php file: function get_category_tags($args) { global $wpdb; $tags = $wpdb->get_results (" SELECT DISTINCT terms2.term_id as tag_id, terms2.name as tag_name, null as tag_link FROM wp_posts as p1 LEFT JOIN wp_term_relationships... [Read the full story]

Get all wordpress custom fields from a page or a post

October 10, 2009

Sometimes you may need to get all custom fields from a specific post or page. How can we do that? Just paste the following functions on the functions.php files from your theme. Note: The function have lots of comments so it will help you to understand how it works. function all_my_customs($id = 0){ //if we want to run this function on a page of our choosing them the next section is skipped. //if not it grabs the ID of the current page and uses it from now on. if ($id == 0) : global $wp_query; ... [Read the full story]