WP Ultimate CMS Taxonomy Shortcodes

I assume WP Ultimate CMS taxonomy short code has not been described completely, So I’d provide some detailed information about it now.

Preparation

Let’s assume there is a taxonomy with
name ‘manufacturer’
Field Types:
1. name: logo, type: image
2. name: website, type: textbox

Sample Terms associated
1. name BMW with a logo and website `http://www.bmw.com/`
2. name AUDI with logo and website `http://www.audi.com/`

Basic Shortcode:

[xy_{taxonomy_name}]

Parameters Associated with Shortcode

  • field
  • start
  • end
  • name_before
  • name_after
  • description_before
  • description_after
  • {field_name}_before
  • {field_name}_after
  • field_term
  • showall
  • fieldcode

Further Examples

1. To show the term details in a post, all we need to do is add following shortcode

Syntax : [xy_{taxonomy_name}]
Example: [xy_manufacturer]
Output : BMWAUDI

2. To show the only website(field) of term in a post, all we need to do is add following shortcode

Syntax : [xy_{taxonomy_name} field="{field_name}"]
Example: [xy_manufacturer field="website"]
Output : http://bmw.comhttp://audi.com

3. To add html code before and after the display of shortcode, all we need to do is add following shortcode

Syntax : [xy_{taxonomy_name} field="{field_name}" start="{HTMLCODE}" end="{HTMLCODE}"]
Example: [xy_manufacturer field="website" start="<span class='class1'>" end="</span>"]
Output : <span class=’class1′>http://bmw.comhttp://audi.com</span>

4. To add html code before and after name or any fieldname the display of shortcode, all we need to do is add following shortcode

Syntax : [xy_{taxonomy_name} {field_name}_before="{HTMLCODE}" {field_name}_after="{HTMLCODE}"]
Example: [xy_manufacturer website_start="<span class='class1'>" website_end="</span>"]
Output : <span class=’class1′>http://bmw.com</span><span class=’class1′>http://audi.com</span>

6 thoughts on “WP Ultimate CMS Taxonomy Shortcodes”

  1. hello there,

    first of all i would like to thank you for the great plugin.

    but i still cant use the plugin in the proper way.

    I created new taxonomy which is ‘artists’ then i added [xy_artists] shortcode to my my single.php but on the page it still shows [xy_artists] not the content of artists.

  2. Xydac, thanks for this awesome plugin.
    My question is: when we use the shortcode to display the taxonomy data, how to separate multiple values with a comma or something?
    Like in your first example, how can I have BMWAUDI separated with a comma: BMW, AUDI?
    (I’m a wordpress rookie.)

    Thanks
    Daniel

    1. Hey Daniel,

      You can use the shortcode with parameter:
      [xy_{taxonomy_name} {field_name}_before=”{HTMLCODE}” {field_name}_after=”{HTMLCODE}”]

      You’ll be knowing the field name just replace the field_name with the name of your field. like if you are using name column to be displayed then
      name_before and name_after will suffice.
      just put a comma in name_after

      Regards,
      Xydac

  3. Thanks for the reply Xydac,

    That was the solution I tried but it is not good enough 🙂
    The thing is that the comma is being part of the field link, and it is also present after the last value, something like: BMW, AUDI,
    Maybe this is something you can include in a next release: for each taxonomy, define a separator string to be used for this cases… just a suggestion.

    Once again, thanks for the plugin, I tried several others and this is THE ONE!
    Best regards,
    Daniel

  4. I’m sorry, I forgot about tags(

    Ignore what I’ve posted before) I have more specific question.

    I have custom taxonomy “countries”. This taxonomy has 2 custom fields (images) – flag and photo.
    How can I make a page with countries (not cities (posts) of this countries but only countries) list? And most important is how can I show flag and photo on this page (img tag only, no wrapping in link tag).
    As I undestand shortcodes can be used only in loops, right? So I need to query countries using WP_Query, query_posts or something like that to get custom field of custom taxonomy through shortcode. Is it even possible (I mean query)?

    Huge thanks in advance!

Leave a Comment

Your email address will not be published. Required fields are marked *