Directory category featured image and layout configuration

How can I change layout for directory listings.
- Change size of featured image in category listing.
- Remove featured image in category listing (not the one from the first post), better set a custom image for the category.
- remove post date
- remove author
- remove 'this entry was posted in <category> by <user>' in single post
- in single post, don't show featured image or category featured image

  • Ash
    • WordPress Hacker

    Hello @Yves

    Welcome to WPMU community!

    I hope you are well today and thanks for asking the question.

    You need to create custom template in your theme. If you post type is listing, you can follow the template of page.php in your theme and create single-listing.php, archive-listing.php etc in your theme.

    Please let us know if you need help with these.

    Cheers
    Ash

  • Ash
    • WordPress Hacker

    Hello @Yves

    Before playing with template page, let me suggest you some css first.

    #dr_listing_list .entry-summary a img{width: auto !important;}
    .entry-meta{display: none;}
    .directory_listing.hentry .image-container{display: none;}

    You can add this to a theme's stylesheet, in a child theme, or using a plugin like My Custom CSS

    Hope it helps :slight_smile: Please feel free to ask more question if you have.

    Cheers
    Ash

  • Yves
    • Design Lord, Child of Thor

    Thanks Ash, In the listing this removed everything.
    But it is as well removed from the single post.
    Purpose was to only have the author and review parts removed from the listing and not from the single post.

    Is there also a way to do it a more modular way. So I can choose to have
    - rating on/off (visible or not) in the list/post,
    - author on/off (visible or not) in the list/post
    - date posted on/off (visible or not) in the list/post
    - add review button on/off (visible or not) in the list/post

  • Ben
    • WPMU DEV Initiate

    Hi Yves - we've previously had a similar requirement to fulfil - you could potentially add custom fields to listings posts allowing you to toggle this content, but perhaps a less technically intensive way to do so in this case, would be to first work towards creating a base template that has all the above features you described switched on.

    You could then create duplicate templates with features edited out as necessary, and name them as such, e.g. template 'rating/author/date' would have the add review button switched off, and the other 3 on.

    The only caveat of this is that you would conceivably end up with 24 templates to create and maintain, which isn't ideal - is there perhaps a way you could condense the options, so you're maybe always switching on/off one or more of the options at the same time - reducing the number of templates required?

    Alternatively, plenty of helpful bods in here if you decide to go the other route and try to create toggles within the post admin page!

    Ben

  • Michael Bissett
    • Recruit

    Hey @Yves,

    Purpose was to only have the author and review parts removed from the listing and not from the single post.

    Is there also a way to do it a more modular way.

    Just to be sure, when you say "listing", are you referring to the listings page? And by "single post", do you mean a single listing?

    I can't offer a modular way of adjusting which fields are visible on what listings (it sounds like @Ben's got some ideas for you though), but I can suggest some CSS code to use in the meantime.

    Please advise,
    Michael

  • Yves
    • Design Lord, Child of Thor

    @Michael, You had that right listing is the listing page, and single post, I was referring to a single listing.

    With the modular way, I was trying to address the entries within the entry-meta class, like the classes
    - author vcard
    - entry-utility
    - cat-links

    I thought if I could refer to these in css, than it would be easy to have them shown or not.
    And then I wanted to make the distinction between the dir listing and the single post listing.
    If I could have nothing shown of the entry-meta class in the directory listing and on the single listing, choose to have the classes mentioned above shown or not, without them having effect on the listing page display.

  • Ash
    • WordPress Hacker

    Hello @Yves

    Your idea is nice. But right this is not possible out of the box. We can help you with the css to hide those option if you want, but I agree providing this solution would be very handy.

    I am marking this thread as a feature request.

    Cheers
    Ash

  • Yves
    • Design Lord, Child of Thor

    Thanks Ash.

    If you can help me with the css, that is more than enough flexibility for the time being.
    But keep in mind that I want to separate the behaviour (showing / hiding blocks) of the listing from the behaviour of the single list post.
    Looking forward to your suggestion.

  • Ash
    • WordPress Hacker

    To apply the css only in listing list page you can try the following:

    body.post-type-archive-directory_listing #dr_listing_list .entry-summary a img{width: auto !important;}
    body.post-type-archive-directory_listing .entry-meta{display: none;}
    body.post-type-archive-directory_listing .directory_listing.hentry .image-container{display: none;}

    This should not affect the single list page.

    Please check and let us know.

    Cheers
    Ash

  • Yves
    • Design Lord, Child of Thor

    Finally tried it out, but doesn't seem to have any effect at all.
    Pasted the code in my custom css (this is the only code in there).

    So if understood, this would affect my directory listing (listing all companies), but not the individual listing (single company display)

    Any idea; why this is not working?

  • Ash
    • WordPress Hacker

    Hello @Yves

    I don't see the css in source code either. Did you use my custom css plugin? Of custom css section of your theme? Can you try the either option?

    Also, do you have any cache plugin installed? If yes, please delete cache and try.

    If it still doesn't work, please enable support access from WPMU DEV > Support.

    Cheers
    Ash

  • Yves
    • Design Lord, Child of Thor

    Hi Ashok, Sorry for the late reply, but I've been on holidays.
    I added your code again in my staging area (using appearance > Custom CSS).
    But no impact on the directory listing, nor the single display (see the 7wData > Data Players)
    I granted support access, so you can have a look to see what is not going as expected.

    Thanks.

  • Yves
    • Design Lord, Child of Thor

    Access granted.

    This is currently how I want the review box to show.

    SHOW review
    http://klym.staging.wpengine.com/listing/vertica/

    HIDE Review
    http://klym.staging.wpengine.com/listings-tag/database/
    http://klym.staging.wpengine.com/listings-category/dataplayers/

    For the individual reviews I still need to change the commenting.
    Currently have the diqus paltform for commenting on articles, which isn't working for reviews of the directory listing.
    But this is being handled in another post in the forum.

  • Yves
    • Design Lord, Child of Thor

    hey @Michael, that's it.
    Now the review shows as I had it in mind.

    **
    Now another thing comes apparent.
    Any idea why in the tag listing (http://klym.staging.wpengine.com/listings-tag/database/), the image is smaller then in the category listing (http://klym.staging.wpengine.com/listings-category/dataplayers/) and the single post listing (http://klym.staging.wpengine.com/listing/vertica/).

    How can this be aligned?
    ... found it out myself.
    Added the auto size to the archive tag listing.
    .archive.tax-listing_tag #dr_listing_list .entry-summary a img{width: auto !important;}

    Thanks to all!!

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.