Regarding Directory plugin layout and on the use of shortcodes

Hello,

I have a couple of questions regarding layout and shortcodes:

1. There is a demo site you have and noticed some things I would like to have on my current setup:

A "view listing" URL and the "star" system rating turned off:

http://screencast.com/t/LftDeLin

Source: http://thewpdirectoryplugin.com/listings-category/business/bar/

I like how the layout is here: http://screencast.com/t/UeErsCoWyuVB

While as the layout in my setup looks so different:
http://ceric.org/listing/recruiter-101-cacee/

I would also would like to move the "Contact" button, or be able to remove it, how to do this?

2. Is there a way to have a shortcode display listings of a category? Maybe there is some parameter to input in the current shortcode:

[dr_list_categories style="grid | list"] ?

  • Patrick

    Hiya @ceric

    A bunch of excellent questions. Let's see if we find some answers :slight_smile:

    First of all, many of the features you're asking about are part of the theme that is included with the plugin. If you are using your own theme and displaying directory features with shortcodes, they will likely look a lot different.

    A "view listing" URL and the "star" system rating turned off:

    The "View Listing" link is actually a "Read more" link that WordPress auto-generates when you use the "More" tag while creating or editing a listing. It is a feature of the plugin theme. Depending on the theme you're using, you can use the "More" tag which may or not display "Read more" with a link to the listing.

    Unfortunately, the plugin does not currently provide the option to turn off the ratings feature. You can get around that though by hiding everything with CSS. Add the following to your theme's style-sheet to get rid of it:
    div.sr-avg-rating, div.sr-rate-this { display:none; }

    ...the layout in my setup looks so different.

    Here again, the shortcode output has zero styling so it doesn't interfere with your theme styles. When using shortcodes, you have the luxury of styling the output exactly how you want it so it fits seamlessly with your theme.

    I would also would like to move the "Contact" button, or be able to remove it, how to do this?

    To move the button/form, you would need to edit the appropriate template in the plugin. Which is not always a good idea, because your customizations will be overwritten when you update the plugin. Here again though, you can hide it from view with the following in your style-sheet:
    form#action-form.contact-user-btn { display:none; }

    Is there a way to have a shortcode display listings of a category?

    Not at this time. The shortcode only allows one parameter: list or grid display. I believe more options are on the roadmap, but I can't provide any kind of ETA for that, sorry.

    Hope this helps! And thanks for being a member :slight_smile:

  • ceric

    @Patrick Cohen thank you, most of your suggestions have worked, except:

    The "View Listing" link is actually a "Read more" link that WordPress auto-generates when you use the "More" tag while creating or editing a listing. It is a feature of the plugin theme. Depending on the theme you're using, you can use the "More" tag which may or not display "Read more" with a link to the listing.

    The "view listing" link did not appear when I used the "read more" function in WordPress. Any suggestions? I guess there needs to be a modification to be made. But then again you mentioned if because of the template. How do I use the default Directory template?

  • Patrick

    Hi again,

    The "view listing" link did not appear when I used the "read more" function in WordPress.

    That means your theme probably doesn't display it by default. However, you can copy the required template to your theme and make the required modification there. That will override the plugin functionality. Here's how:

    1. Download the Directory plugin files to your computer.
    2. Open this file in a text editor: directory/ui-front/general/loop-taxonomy.php
    3. Scroll down to where you see this in the loop:

    <?php
    endif;
    the_excerpt();
    ?>

    4. Add the following just after that (you may need to insert a blank line first):
    <a href="<?php the_permalink(); ?>">View Listing</a>
    5. Save your new file, under the same name, to the root of your theme. Do not overwrite the plugin file. If you are using a child-theme, this must be saved to the parent theme. Note that when you update the parent theme, you will likely need to move this file in there again.

    Once that's done, you won't need to use the "More" tag or do anything else. The "View Listing" will automatically link to the appropriate individual listings.

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.