Business Directory Plugin
Easy way to relocate images in listing page (2 posts)

  1. superpotion
    Posted 3 years ago #

    Thought someone might find this useful. I needed to relocate the listing images from the bottom of the page to another postition. In my case just above my Description 'as Content' field

    At the same time I wanted to avoid changing the plugin code so that my mods would survive plugin updates. Here's what I did.

    1. In the Manage Form Fields admin menu create a new text field (I called it IMAGES), and position it in the listing where you'd like the images to appear.
    2. Edit the listing in the directory and insert a unique string into the newly created field (I inserted the text images go here)
    3. Copy the file wp-content/plugins/business-directory-plugin/templates/businessdirectory-listing.tpl.php to your theme folder and edit, replacing lines 17-28 with this...
    <?php $listing_fields_split = explode ( '<div class="field-value wpbdp-field-images meta"><label>IMAGES:</label> <span class="value">images go here</span></div>', $listing_fields ); ?>
    <div class="listing-details-0 listing-details cf <?php if ($main_image): ?>with-image<?php endif; ?>">
        <?php echo $listing_fields_split[0];?>
    <?php if ($extra_images): ?>
    <div class="extra-images">
        <?php foreach ($extra_images as $image): ?>
            <li><?php echo $image; ?></li>
        <?php endforeach; ?>
    <div class="listing-details-1 listing-details cf">
        <?php echo $listing_fields_split[1]; ?>

    You ca use the new CSS classes listing-details-0 and listing-details-1 for styling control.

    Not the most elegant solution, but it works!


  2. businessdirectoryplugin
    Plugin Author

    Posted 3 years ago #

    Thanks for the tip, nice hack. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Business Directory Plugin
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.