WordPress.org

Ready to get started?Download WordPress

Forums

Tag Cloud has HTML Line Breaks after Each Tag? (8 posts)

  1. fncll
    Member
    Posted 6 years ago #

    I am calling my tag cloud on a wordpress page (literally a page, edited in the dashboard) with the code:
    wp_tag_cloud('smallest=8&largest=36&number=0&')

    which should show all tags separated only by whitespace, but instead I am getting all tags separated by an html BR tag. How can I get rid of the line breaks?

  2. fncll
    Member
    Posted 6 years ago #

    Is no one else having this problem?

  3. mars-hill
    Member
    Posted 6 years ago #

    I'm also having this problem. Using WP2.3 and the default tag call.

    Any help would be appreciated.

  4. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    wp_tag_cloud doesn't add BR tags. But..

    (literally a page, edited in the dashboard)

    You're using something like RunPHP aren't you? Well, don't do that. Page content is automatically reformatted to be HTML friendly. While wp_tag_cloud only outputs newlines, WordPress will convert those to BR's when they occur in Post or Page content.

    Instead of using RunPHP and other hacks, create a Page Template and put your PHP code there. Then use that Page Template for your Page instead.

  5. mars-hill
    Member
    Posted 6 years ago #

    Indeed, I'm using exec-php. That sucks since I don't really want to create 200 different if/then statements for all the php I use in posts and pages.

    Does anyone know of a "new" tag plugin that isn't going to screw things around?

    (I never had any hassles with UTW in the past. It'll be hard to go back.)

  6. mars-hill
    Member
    Posted 6 years ago #

    Sorry Otto,

    I misunderstood you. (Damn text-based communication!)

    One can still run php plugins but one cannot run <?php wp_tag_cloud(''); ?> within the page.

    One more page template isn't too much of a problem though :)

    Now running on http://www.indietravelpodcast.com/tags

    Thanks Otto!

  7. rbredow
    Member
    Posted 6 years ago #

    I had the same problem. I wanted to continue to use runPHP so wrote a very simple plugin that filters out the \n's created by wp_tag_cloud and replaces them with spaces. The

    You can grab the plugin here:

    I would suggest that maybe for a future version of WordPress, the main code could use a space instead of a /n for separating the tags.

  8. object81
    Member
    Posted 5 years ago #

    Anyone with a solution to this issue? The 'wordpress-tag-cloud-formatting' plugin doesn't work on WP 2.6. The wp_tag_cloud() function should take the parameter format=flat, but in IE there are still line breaks after each tag.

Topic Closed

This topic has been closed to new replies.

About this Topic