<?php if ( function_exists('wp_tag_cloud') ) : ?>
<?php wp_tag_cloud('smallest=8&largest=22'); ?>
<?php endif; ?>
No need for ul etc. as by default there are none.
If want ul etc. then use
<?php if ( function_exists('wp_tag_cloud') ) : ?>
<?php wp_tag_cloud('smallest=8&largest=22&format=list'); ?>
<?php endif; ?>
Again, no need to manually add in ul li etc. Look in source code and see what’s been churned out, then use that to style it.
π
Thanks for your response…but that does not solve my issue. The problem is I don’t understand the “li” and “ul” tags very well…so when I add this code
<?php if ( function_exists('wp_tag_cloud') ) : ?>
<?php wp_tag_cloud('smallest=8&largest=22&format=list'); ?>
<?php endif; ?>
to my sidebar…I get 8 validation errors concerning the “li” and “ul” tags which can be found here
http://validator.w3.org/check?uri=http%3A%2F%2Flovelatoya.com&charset=%28detect+automatically%29&doctype=Inline&group=0
I know that the tag cloud code I’m adding is correct…I just don’t know how to add it to my existing code so that it will still validate. Any suggestions?
Have you taken the tag cloud out for good now? Can’t see it on that page, and the page validates.
Copy the relevant HTML and paste it here if you still want to get it to work.
Yes I took the tag cloud out because I couldn’t figure it out. Now I have just added the following code back to my sidebar
<?php if ( function_exists('wp_tag_cloud') ) : ?>
<?php wp_tag_cloud('smallest=8&largest=22'); ?>
<?php endif; ?>
and I am getting 2 validation errors.
http://validator.w3.org/check?uri=http%3A%2F%2Flovelatoya.com&charset=%28detect+automatically%29&doctype=Inline&group=0
Here is my sidebar code now…
http://wordpress.pastebin.ca/809567
Thanks for responding
What you have is this:
<ul class="list-cat">
<?php if ( function_exists('wp_tag_cloud') ) : ?>
<?php wp_tag_cloud('smallest=8&largest=22'); ?>
<?php endif; ?>
</ul>
</li>
</ul>
What you need is this:
<?php if ( function_exists('wp_tag_cloud') ) : ?>
<?php wp_tag_cloud('smallest=8&largest=22'); ?>
<?php endif; ?>
That will produce something like this:
<a href='http://www.mysite.com/?tag=oranges' class='tag-link-14' title='1 topics' style='font-size: 8pt;'>oranges</a>
<a href='http://www.mysite.com/?tag=plums' class='tag-link-7' title='2 topics' style='font-size: 15pt;'>plums</a>
<a href='http://www.mysite.com/?tag=peaches' class='tag-link-8' title='3 topics' style='font-size: 22pt;'>peaches</a>
In other words, you don’t need
<ul>
<li> </li>
</ul>
If you DO want
<ul>
<li> </li>
</ul>
elements, it will be done automatically by using this:
<?php if ( function_exists('wp_tag_cloud') ) : ?>
<?php wp_tag_cloud('smallest=8&largest=22&format=list'); ?>
<?php endif; ?>
Which will produce something like this:
<ul class='wp-tag-cloud'>
<li><a href='http://www.mysite.com/?tag=oranges' class='tag-link-14' title='1 topics' style='font-size: 8pt;'>oranges</a></li>
<li><a href='http://www.mysite.com/?tag=plums' class='tag-link-7' title='2 topics' style='font-size: 15pt;'>plums</a></li>
<li><a href='http://www.mysite.com/?tag=peaches' class='tag-link-8' title='3 topics' style='font-size: 22pt;'>peaches</a></li>
</ul>
Note that NO
<ul> or
<li>
elements were added – WordPress did it automatically, producing an unordered list with a class of wp-tag-cloud which you can style from inside your style.css e.g. ul.wp-tag-cloud {font-style:normal;}
π
Ok, so I followed your advice and added
<?php if ( function_exists('wp_tag_cloud') ) : ?>
<?php wp_tag_cloud('smallest=8&largest=22'); ?>
<?php endif; ?>
and now I have 6 more errors than I did before. Here is my sidebar code now. Did i do something wrong?
http://wordpress.pastebin.ca/810622
Thank u so much Richard for all your help..It is valid now..The problem was that I needed to add the </li></ul> before adding the tag cloud code. Thank u again!