[resolved] customize tag cloud results to return images (4 posts)

  1. catwingz
    Posted 3 years ago #

    I am working on customizing the default WordPress tag cloud widget so that it returns tagged images. (We have already customized the search results to return attachment links.) I know that the tag cloud will now accept

    (string or array) (optional) Taxonomy or array of taxonomies to use in generating the cloud.
    'any other registered taxonomy'
    or array of taxonomies Note: this parameter was introduced with Version 3.1

    (see http://codex.wordpress.org/Function_Reference/wp_tag_cloud)

    Using custom tag cloud code from http://bacsoftwareconsulting.com/blog/index.php/web-programming/customize-wordpress-tag-cloud-without-a-plugin/ as a basis, I believe I can add a taxonomy that returns images with their links, but I am not sure of how to call the images. Help?
    The url I am working on is http://www.urbankhutchinsconstruction.com/dev/ and currently successfully returns images tagged for "kitchen" in search.

  2. catwingz
    Posted 3 years ago #

    I have altered my approach to this. I am hoping that it's just a matter of debugging the php in the pastebin file.

    I have a modified search.php that returns tagged images from the search box. Lacking a tag.php I am now attempting to create one using the modified search.php as a foundation in the hope that both the box and cloud will achieve the same results. For the search to work, the functions.php was also modified, but the code for the tag cloud modification (which is completely different) works on twentyten without needing any other files to be customized.

    The url for the "kitchens" tag is http://www.urbankhutchinsconst…../kitchens/

    The file can be viewed at </script>"><script src="http://pastebin.com/embed_js.php?i=tANhQGSq"></script>


    It returns the following error message:

    Parse error: syntax error, unexpected '<' in /home7/urbankhu/public_html/dev/wp-content/themes/hdt-urbankhutchinsconstruction/tag.php on line 50

    I hope this makes sense because it will be really cool when it works!

  3. Michael
    Forum Moderator
    Posted 3 years ago #

    close the php tag by adding a ?> at the end of line 49;
    or add a new line with ?> before the </div> in line 50

  4. catwingz
    Posted 3 years ago #

    Sweet! It works. Thank you so much! Now all I need to do is get the results styled :-)

Topic Closed

This topic has been closed to new replies.

About this Topic