WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. superpotion
    Member
    Posted 1 year 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];?>
    </div>
    
    <?php if ($extra_images): ?>
    <div class="extra-images">
        <ul>
        <?php foreach ($extra_images as $image): ?>
            <li><?php echo $image; ?></li>
        <?php endforeach; ?>
        </ul>
    </div>
    
    <div class="listing-details-1 listing-details cf">
        <?php echo $listing_fields_split[1]; ?>
    </div>

    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!

    http://wordpress.org/extend/plugins/business-directory-plugin/

  2. businessdirectoryplugin
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for the tip, nice hack. :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.