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-
AuthorPosts
-
November 25, 2017 at 9:39 pm #406810
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.
November 26, 2017 at 1:49 pm #406849Hello!
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/November 27, 2017 at 12:11 am #406882Can 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.
November 27, 2017 at 6:34 am #406909Hello!
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.
November 27, 2017 at 6:45 am #406914I’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.
November 27, 2017 at 11:43 am #406942Hi 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.phpif ( ! defined( 'SD_DEFAULT_FEATURED_IMAGE' ) ) { define( 'SD_DEFAULT_FEATURED_IMAGE', "https://MYSITE.com/uploads/2017/11/featured.jpg" ); }
Let us know.
Thanks,
KiranNovember 27, 2017 at 7:32 pm #407014Hi 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.
November 27, 2017 at 7:36 pm #407015Joy 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?
November 27, 2017 at 7:41 pm #407016Yes, I have set this page to be full width, there is no sidebar so I think this would address a double scrolling concern.
November 27, 2017 at 9:49 pm #407042Hello!
That would be a customization, but you have lots of information here about the ‘pieces’ that would be needed.
November 27, 2017 at 11:57 pm #407054Sorry, 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.
November 28, 2017 at 10:34 am #407116The 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
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket