Archive Details Customization
-
I’m working with adding details in the archive section of this plugin, as my client is looking for more customization than the plugin originally allowed.
I added in “Number of Units” as an option for the client to put in on each listing, and I’ve currently got that showing on the archive page for each listing. However, now I’m looking to add “Number of Units:” before that returned data, and I only want it to show up if the data exists because not all listings are applicable to having units.
I created another function (just as exists for pulling in the address) in the functions.php file called “wp_listings_get_units.”
Here is my current code:
function wp_listings_get_units($post_id = null) { global $post; $units = get_post_meta ($post->ID, '_listing_units', true); if ( '' == $units ) { $units = ''; } return $units; }I’m thinking it needs to have “Number of Units:” included where the variable $units is defined, but I can’t seem to get it to combine with the information that already exists in $units’ definition.
I assumed an array would take care of this, but when I defined it as an array with the string “Number of Units” and the rest of that, it only outputs the word “array” underneath the city and state on the archive pages.
Here is an example of a page that will be using this:
http://rcre.com/multifamily-properties-wernke-team/
To recap, right now it shows the number of units, but I’m wanting to add “Number of Units:” right before that text but only when a number exists.
The topic ‘Archive Details Customization’ is closed to new replies.