GeoDirectory SupportGet listing description and images – GeoDirectory Support https://wpgeodirectory.com/support/topic/get-listing-description-and-images/feed Fri, 20 Feb 2026 05:27:01 +0000 http://bbpress.org/?v=2.5.14-6684 en-US https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21036 <![CDATA[Get listing description and images]]> https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21036 Sun, 09 Nov 2014 08:59:46 +0000 halalcompass Hello,

I’m looking for a bit of help extracting the listing description and images so I can move them outside of the tab.

I do not want to use the tabs on the listing detail page, but would rather have each bit of content underneath each other.

I’ve been able to rearrange most of it using hooks, but can’t seem to find how to pull just the description and image thumbnails.

Any help would be greatly appreciated. Thanks!

]]>
https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21094 <![CDATA[Reply To: Get listing description and images]]> https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21094 Mon, 10 Nov 2014 16:54:06 +0000 Paolo Hi,

listing description will be the default wordpress API for post description.



<?php the_content(); ?>

While for the post thumbs will be:


<?php $post_images = geodir_get_images($post->ID,'thumbnail');
		$thumb_image = '';
		if(!empty($post_images)){
			foreach($post_images as $image){
				$thumb_image .=	'<a href="'.$image->src.'">';
				$thumb_image .= geodir_show_image($image,'thumbnail',true,false);
				$thumb_image .= '</a>';
			}
		}

echo $thumb_image;?>

For reference, these can be found in “function geodir_show_detail_page_tabs()” in “custom_functions.php” file starting from line 842.

Thx

]]>
https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21260 <![CDATA[Reply To: Get listing description and images]]> https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21260 Wed, 12 Nov 2014 12:11:31 +0000 halalcompass Thank you very much! This was exactly what I was looking for. I probably came across it in custom_functions.php but not knowing knowing PHP fluently, I didn’t realize I could just use that part.

For anyone interested, I basically placed these each in their own function, and then used an action to load each piece on the page.

]]>
https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21262 <![CDATA[Reply To: Get listing description and images]]> https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21262 Wed, 12 Nov 2014 12:22:36 +0000 halalcompass Spoke too soon for the image thumbnails. I used the code below, but thumbnails don’t show. Any idea where I went wrong?


add_action('geodir_details_main_content', 'geodir_detail_page_images_hc', 31);
function geodir_detail_page_images_hc() {
	$post_images = geodir_get_images($post->ID,'thumbnail');
		$thumb_image = '';
		if(!empty($post_images)){
			foreach($post_images as $image){
				$thumb_image .=	'<a href="'.$image->src.'">';
				$thumb_image .= geodir_show_image($image,'thumbnail',true,false);
				$thumb_image .= '</a>';
			}
		}

	echo $thumb_image;
}
]]>
https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21284 <![CDATA[Reply To: Get listing description and images]]> https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21284 Wed, 12 Nov 2014 16:41:14 +0000 Paolo Hi,

I think all that is needed is in function to add:


global $post;

When inside function there is not access to post unless u make it a global var.

Please try:


add_action('geodir_details_main_content', 'geodir_detail_page_images_hc', 31);
function geodir_detail_page_images_hc() {
global $post;
 $post_images = geodir_get_images($post->ID,'thumbnail');
  $thumb_image = '';
  if(!empty($post_images)){
   foreach($post_images as $image){
    $thumb_image .= '<a href="'.$image->src.'">';
    $thumb_image .= geodir_show_image($image,'thumbnail',true,false);
    $thumb_image .= '</a>';
   }
  }

Let us know,

Thx

]]>
https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21371 <![CDATA[Reply To: Get listing description and images]]> https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21371 Thu, 13 Nov 2014 10:22:06 +0000 halalcompass Hmm, still not able to get this working. I also tried adding $post_images to the “global” but still nothing.

Here is the latest code I’m using.


add_action('geodir_details_main_content', 'geodir_detail_page_images_hc', 31);
function geodir_detail_page_images_hc() {
	global $post, $post_images;
	$post_images = geodir_get_images($post->ID,'thumbnail');
		$thumb_image = '';
		if(!empty($post_images)){
			foreach($post_images as $image){
				$thumb_image .=	'<a href="'.$image->src.'">';
				$thumb_image .= geodir_show_image($image,'thumbnail',true,false);
				$thumb_image .= '</a>';
			}
		}
	echo $thumb_image;
}

You may view the page here: http://halalcompass.com/places/toronto/schools/al-azhar-islamic-school/

Thanks for all your help.

]]>
https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21440 <![CDATA[Reply To: Get listing description and images]]> https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21440 Thu, 13 Nov 2014 18:13:10 +0000 Stiofan O'Connor OK this was working 100% but you have no styling applied so the divs have no dimensions, if you want standard GT styleing like in the tab just add the wrapper div like this…


add_action('geodir_details_main_content', 'geodir_detail_page_images_hc', 31);
function geodir_detail_page_images_hc() {
	global $post, $post_images;
	$post_images = geodir_get_images($post->ID,'thumbnail');
		$thumb_image = '';
		if(!empty($post_images)){
			$thumb_image .= '<div id="geodir-post-gallery" class="clearfix">';
			foreach($post_images as $image){
				$thumb_image .=	'<a href="'.$image->src.'">';
				$thumb_image .= geodir_show_image($image,'thumbnail',true,false);
				$thumb_image .= '</a>';
			}
			$thumb_image .= '</div>';
		}
	echo $thumb_image;
}

Thanks,

Stiofan

]]>
https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21655 <![CDATA[Reply To: Get listing description and images]]> https://wpgeodirectory.com/support/topic/get-listing-description-and-images/#post-21655 Sun, 16 Nov 2014 11:06:12 +0000 halalcompass That worked wonderfully. Thank you.

]]>