- This topic has 11 replies, 3 voices, and was last updated 4 years, 4 months ago by Tom.
-
AuthorPosts
-
November 6, 2019 at 9:07 am #1055048Samuel
Hi,
I looked into this for hours and can’t find a way to customize my archive.php file as needed.
I need my category pages to look like a classic page with :
1 / Hero Header with Title and featured image.
2 / A content part that I can edit to put some text to explain what this category is about and where I can add a shortcode to display all posts of this category with filter (I use “The Grid” plugin to do that).Is there a way to customize archive.php to display like page.php backend and frontend ?
I tried to copy my page.php file and plage it on my Child Theme and rename it archive.php but obviously it does not work… I really don’t know nothing about PHP and I’m just following step by step tutorials to modify things when needed.
1 / Regarding Header
I tried to use Element to customise Header of “All archives” but nothing happened. Even just a color change attribute. So it’s weird but anyway there is no option to put a featured image on category backend, so I think Element can’t do more about this ?2 / Regarding Content
There is a “description” field that is not displaying frontend. But maybe there is a way to display it ? In that case it could be a solution to solve part of the problem BUT I would need to be able to style the text and display my shortcode in it… wCould you help me with all this ?
My website is actually running on local.
Thanks a lot !
SamuelNovember 6, 2019 at 3:53 pm #1055382DavidStaffCustomer SupportHi there,
may be simplest for you to redirect category archives to a static page, then you can do as you please with the content. This article explains how to do that:
https://docs.wpshowposts.com/article/use-static-pages-as-category-archives/
November 7, 2019 at 3:27 am #1055685SamuelThanks David, I was thinking about that very simple idea indeed ! But I was wandering if it has no side effects regarding SEO or “Google undestanding”. Anyway I think I will follow your advise.
November 7, 2019 at 5:02 am #1055786DavidStaffCustomer SupportNo side effects SEO wise as any Category links will redirect to your custom archive page which is what will get indexed by Google.
The only ‘negative’ is you have to build them manually for each category and make sure slugs match. So a little more hands on.November 7, 2019 at 5:09 am #1055797SamuelThanks David !
November 7, 2019 at 5:14 am #1055802DavidStaffCustomer SupportYou’re welcome
December 6, 2019 at 11:09 am #1096247SamuelHello back ! I was wondering if same feature was possible with tags ? Thanks for your help
December 6, 2019 at 8:07 pm #1096592TomLead DeveloperLead DeveloperI’m not sure if that’s possible (never tested it). You could try replacing
category_name
withtag_name
in the code.December 7, 2019 at 1:05 am #1096721SamuelHi Tom, thanks for your reply, this is sadly not working, I will have to make all my tags to be categories, do you know if there is a hook to do so automatically or do you recommend to handly redirect 301 every one of it ?
December 7, 2019 at 9:44 am #1097170TomLead DeveloperLead DeveloperWhat about just using
tag
instead oftag_name
?December 8, 2019 at 3:00 am #1097619SamuelIt’s working ! Thanks Tom
December 8, 2019 at 10:09 am #1097953TomLead DeveloperLead DeveloperYou’re welcome 🙂
-
AuthorPosts
- You must be logged in to reply to this topic.