Directory Plugin: Can we improve the Featured Image size and modify the button syntax?

Hi everyone –

Directory is a great plug-in. Thank you!

1. Can we better utilize the empty header space to improve the way the featured image appears in the heading on a single directory post as shown in the two images I’m attaching?

2. Can we modify the button text based on Directory categories? For example, if the category is “Shops,” could we force the button to say “Contact Merchant” ?

Here’s a link to the example: http://quiltersbug.com/listing/olde-city-quilts/

And just a thought… the header with featured image for Classifieds is more the way I feel that Directory header/featured image should appear. The image is larger; but I’d love for that image to take up the full available space for directory. Thank you!

I appreciate your great support.

James

[attachments are only viewable by logged-in members] [attachments are only viewable by logged-in members]

  • Tyler Postle
    • Recruit

    Hey again James,

    Hope you're doing well today and thanks for your questions!

    1. Can we better utilize the empty header space to improve the way the featured image appears in the heading on a single directory post as shown in the two images I'm attaching?

    This may differ a little bit theme to theme; however, in this case do you want to increase the size of the image? and then perhaps bring the listing information to the left?

    Here's how to increase the size of the image:

    Open up your single-listing.php file located:

    /wp-content/plugins/directory/ui-front/general

    Open it in a text editor and find approx. line 69.

    Change the '100' to whatever size you want the image to be. If you change it to 300 then the image will be 300×300.

    I have attached a screenshot to illustrate.

    Then to pull the directory info to the left(if you want) just add this to your custom css sheet:

    .directory_listing .entry-meta {
    float: left;
    }

    2. Can we modify the button text based on Directory categories? For example, if the category is "Shops," could we force the button to say "Contact Merchant" ?

    Since this is using the same template file for each category you would need to add some custom code to achieve this. However, you can easy change the button text inside single-listing.php around line 129.

    Another option if you aren't a coder is making 2 different single listing templates and using this method: http://www.wpbeginner.com/wp-themes/create-custom-single-post-templates-for-specific-posts-or-sections-in-wordpress/

    to link a single listing template to a category. Then you can change that text in each listing template and it will be pulled for the category you list in the functions.php via the above tutorial.

    And just a thought… the header with featured image for Classifieds is more the way I feel that Directory header/featured image should appear. The image is larger; but I'd love for that image to take up the full available space for directory. Thank you!

    Using the image re-sizing method above you should be able to do this :slight_smile:

    Hope that helps James! Sorry for the delay on your previous regular expressions post too. Still working my way back to it – we're currently 5 staff down this weekend due to WordCamp Europe.

    Look forward to hearing back :slight_smile:

    Cheers,

    Tyler

    [attachments are only viewable by logged-in members]

  • James Wolfensberger
    • The Incredible Code Injector

    Thanks man – I’ll work on these tonight. It looks like you totally get what I’m saying.

    As always, I apologize that I’m more admin/designer than coder, but should I be thinking of a way to adjust php content so that plug-in updates won’t wipe them out?

    Or do I just have to keep a backup copy and make the adjustment again when the plugin gets updated?

    James

  • Tyler Postle
    • Recruit

    Hey James,

    Glad we’re on the same page here!

    No problem, I’m kind of the same – although this job has definitely forced me into the coding side more too which is definitely good for me :slight_smile:

    Place the single-listing.php template in your child theme folder or theme folder if you don’t have a child theme. Then it won’t get overwritten on updates :slight_smile:

    You can do this with almost any page templates and/or archive templates.

    Just copying it is fine – if it’s in both locations then it will always take the one in your current theme folder first.

    Hope that helps!

    Cheers,

    Tyler