Category page template

This topic contains 11 replies, has 5 voices, and was last updated by  Stiofan O’Connor 6 years, 11 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #406810

    Joy
    Buyer
    Post count: 1076

    Hi guys. When using the Supreme theme, how do I add a featured image on the category pages? I know I’ve figured this one out before but I spent a while going through my posts and searched the forum and can’t seem to locate help with this.

    Please advise, thank you.

    #406849

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    Category pages are created dynamically, so they don’t have the normal WP “Featured Image.

    Some other members have found various uses for the category image, the one that is uploaded for each category. Here’s a function to call the image:

    
    
    
    geodir_get_default_catimage($term_id, $post_type);
    

    You can then proceed to customize your own version of the listing page, which is responsible for creating the ‘category’ archive pages. This is the location of the file: /wp-content/plugins/geodirectory/geodirectory-templates/geodir-listing.php

    Your new function will need to check the page type to make sure it is a category listing page, grab the category image, and then format the the output with additional CSS.

    Related Links:
    https://wpgeodirectory.com/docs/customizing-geodirectory-templates/

    #406882

    Joy
    Buyer
    Post count: 1076

    Can you share any posts that address this, because I have not been successful.

    Is there no way to add the same featured image to these pages that are used in other GD pages?

    Also, how would I specify the cat image? Can I add a code snippet instead of modifying the template? Thank you.

    #406909

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    There are no posts that I Have found with snippets with exactly what you are looking for.

    The feature that you are talking about would be associated with the category properties page, where you set the category name, slug, description, and two images there, one for the map pin, and one for the Default image for listings in that category.

    Additional functionality would probably be added to that form/feature in one way or another.

    #406914

    Joy
    Buyer
    Post count: 1076

    I’m sorry but I am having some difficulty following you. Let’s try this again.

    How can I add the feature/header image that is generated when using the Supreme theme to the category page?

    I do not wish to set a separate category image, I just with to have the same featured image that is used throughout the header of the Supreme theme to also appear on the category page. On the demo, this would be the image on most pages of the map.

    And can this be achieved with a code snippet instead of editing a template file?

    Thank you.

    #406942

    Kiran
    Moderator
    Post count: 7069

    Hi Joy,

    The featured on the WP categories pages is managed by either one of following ways.
    – If you have set any page under Settings > Reading > Your homepage displays > Posts page > XYZ & featured image has been set for that XYZ page, then that featured images used to display for category pages.
    OR
    – If you have not set “Posts page” or have empty featured image for the page “Posts page > XYZ” then you can set featured image by adding following line in wp-config.php

    
    
    if ( ! defined( 'SD_DEFAULT_FEATURED_IMAGE' ) ) {
        define( 'SD_DEFAULT_FEATURED_IMAGE', "https://MYSITE.com/uploads/2017/11/featured.jpg" );
    }

    Let us know.

    Thanks,
    Kiran

    #407014

    Joy
    Buyer
    Post count: 1076

    Hi Kiran,

    Thank you. But for some reason I still don’t think we’re communicating about the same matter. Let me try again:

    Do you see the featured image that is set here?: https://wpgeo.directory/supreme-directory/

    I would also like to set a featured image here: https://wpgeo.directory/supreme-directory/places/attractions/

    It does not need to be a custom image. It can be the same image used as the default featured image. I just would like a featured image on the category page.

    How do I do this with a code snippet or what template do I need to edit to create this effect?

    Thank you.

    #407015

    Paolo
    Site Admin
    Post count: 31206

    Joy that would break the page layout and require 2 scroll on the same page (a UX monstrosity). Are you sure you want to do that?

    #407016

    Joy
    Buyer
    Post count: 1076

    Yes, I have set this page to be full width, there is no sidebar so I think this would address a double scrolling concern.

    #407042

    Alex Rollin
    Moderator
    Post count: 27815

    Hello!

    That would be a customization, but you have lots of information here about the ‘pieces’ that would be needed.

    #407054

    Joy
    Buyer
    Post count: 1076

    Sorry, but the pieces that were provided earlier do not really address my inquiry.

    @paolo can you provide any additional insight? What Kiran provided was to change the featured image, but that’s not what I’m hoping to do here.

    Thank you.

    #407116

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    The category page was not designed to have a top banner featured image, there is not settings to be able to do this, it would require customisation.

    Thanks,

    Stiofan

Viewing 12 posts - 1 through 12 (of 12 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount