Title: WORKING CODE SNIPPETS
Last modified: September 7, 2019

---

# WORKING CODE SNIPPETS

 *  [dmunaretto](https://wordpress.org/support/users/dmunaretto/)
 * (@dmunaretto)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/working-code-snippets/)
 * Post your working code snippets here, so that Eliot or Peter Berger doesn’t have
   to respond to everything!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Thread Starter [dmunaretto](https://wordpress.org/support/users/dmunaretto/)
 * (@dmunaretto)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/working-code-snippets/#post-11908300)
 * Use: This passes an agent ID from the field property_agent on a page with post
   type PROPERTY and returns data from the custom post type AGENT-
 * [pass field=property_agent]
    Agent Email: [loop type=agent id={FIELD}] [content
   type=agent field=agent_email] [/loop] [/pass]
 *  Thread Starter [dmunaretto](https://wordpress.org/support/users/dmunaretto/)
 * (@dmunaretto)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/working-code-snippets/#post-11908303)
 * This returns the list of all items within a taxonomy – In my case it returns 
   a list of all cities within the taxonomy city:
 * [for each=property-city]
    [each name] [/for]
 *  Thread Starter [dmunaretto](https://wordpress.org/support/users/dmunaretto/)
 * (@dmunaretto)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/working-code-snippets/#post-11908304)
 * I use this code to change the header based of a widget based on the property 
   type –
 * [if field=acf_property_type value=”Land”]
    Vacant Land [/if]
 * [if field=acf_property_type value=”Single Family”]
    Single Family [/if]
 * [if field=acf_property_type value=”Rental”]
    Rental Properties [/if]

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘WORKING CODE SNIPPETS’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/custom-content-shortcode_766976.svg)
 * [Custom Content Shortcode](https://wordpress.org/plugins/custom-content-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/custom-content-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-content-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-content-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-content-shortcode/reviews/)

 * 3 replies
 * 1 participant
 * Last reply from: [dmunaretto](https://wordpress.org/support/users/dmunaretto/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/working-code-snippets/#post-11908304)
 * Status: not a support question