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]

Display allowed tags in wordpress comments

February 10, 2009

Do you know that your readers can use some HTML tags in the comments form? In order to make things easier for them, you should notify your readership about what HTML tags they can use in the comment form. Here’s an easy way to do it. edit your comments.php file and paste the following code just above the comment form: Allowed tags: <?php echo allowed_tags(); ?>  Read More →

Create a tag page on your WordPress blog

January 7, 2009

The problem of displaying tags in your sidebar is that it isn’t really readable, which caused many wordpress bloggers to get rid of tags. How to create a tage page to display your wordpress blog tags in a more readable manner? To create your tag page, the first thing to do is to create a page template. Paste the following code in it if you don’t know how to create one: <?php /* Template Name: Tags */ <h2>All tags</h2> wp_tag_cloud('number=0'); ?> That’s simple as that! The number=0 parameter specifies... [Read the full story]

Get the list of wordpress post that have no tags yet

January 5, 2009

If you ever wanted to get a list of your wordpress blog posts that have no tags yet, here’s a nice recipe for you, where we will show you how to easily create a custom loop and check out if your wordpress posts have tags or not. To get the list of un-tagged wordpress posts, simply paste this custom loop anywhere or your wordpress theme, or use a page template. This loop will only show posts that haven’t been tagged yet. <?php query_posts('orderby=title&order=asc&showposts=-1'); ?> <?php if (have_posts())... [Read the full story]

Display WordPress Tags in a Drop-Down Menu

September 27, 2008

Tags are useful to any blog: As you know it, they allow the user to display a list of posts related to a subject. Most of the time, tags are displayed with in a tag cloud. If you have 20 different tags, that’s ok, but if you have 100 or more tags your tag cloud will be very hard to read, and no-one will click on it. This is probably why many blogs recently stopped displaying their tag cloud, or put it on a separate page. First, we have to create a php function. Copy and paste the following code in the functions.php file... [Read the full story]