Site logo

Archived topic

Customise Archive.php

11 replies · Started by Samuel on November 6, 2019

Viewing posts 1–12 of 12

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... w

Could you help me with all this ?

My website is actually running on local.

Thanks a lot !
Samuel

Thanks 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.

No 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.

Thanks David !

You're welcome

Hello back ! I was wondering if same feature was possible with tags ? Thanks for your help

I'm not sure if that's possible (never tested it). You could try replacing category_name with tag_name in the code.

Hi 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 ?

What about just using tag instead of tag_name?

It's working ! Thanks Tom

You're welcome :)

This archived topic is closed to new replies.