- This topic has 9 replies, 4 voices, and was last updated 3 years, 1 month ago by
Ying.
-
AuthorPosts
-
October 17, 2021 at 6:32 am #1966018
FunkyCss
Hello There,
I remember in older versions Generatepress had the get_template_part( content, etc.. )
Now I notice that is tottaly different and I am really confused how it actually works? ( generate_do_template_part( ‘archive’ ); )
What I need to do is
To create a CPT of displaying archives ( Created a custom taxonomy and copied the archives.php )
Now I need to customise the loop content of this CPT by copy the content.php and renaming products-content.php
I believe I am right till here.
The issue is that I dont understand where to hook that products-content.php as the templating is a bit different.
October 17, 2021 at 6:51 am #1966034David
StaffCustomer SupportHi there,
in your custom archive template you can switch this line:
to:
get_template_part( 'content', 'your-cpt-content-slug' );October 19, 2021 at 4:14 am #1968192FunkyCss
Hi David,
Yes this is with the old way and it actually works.
I am curious tho how works the new one, there is any documentation for this ? Just curious
Thank you once again.
October 19, 2021 at 4:18 am #1968195David
StaffCustomer SupportIts just a custom function.
So you can leave it as is for example:generate_do_template_part( 'your-cpt-content-slug' );It will return exactly this:
get_template_part( 'content', 'your-cpt-content-slug' );October 19, 2021 at 4:25 am #1968204FunkyCss
OK thank you a ton !
October 19, 2021 at 4:28 am #1968208David
StaffCustomer SupportYou’re welcome
February 3, 2023 at 4:47 am #2519884Alberto
Hello,
I think I’m in the same case as FunkyCss but with standard WP categories: I need to make a custom html markup for the post in archive (or category) but I don’t quite understand how I have to do it.
Could you explain me wich is the .php file I must edit or create?Thanks in advance
February 3, 2023 at 6:30 am #2519997David
StaffCustomer SupportHi there,
are you wanting to modify the HTML of the standard archive pages ? Or is it for a specific post type or taxonomy or… ?
February 3, 2023 at 12:35 pm #2520557Alberto
Hi David
Thank you for replying.
It’s for standard archive pages. In fact, for standard category.Regards
February 3, 2023 at 1:57 pm #2520628Ying
StaffCustomer SupportHi Alberto,
Take a copy of
content.phpfile from the parent theme, paste it into your child theme folder, then you can edit the file in the child theme. -
AuthorPosts
- You must be logged in to reply to this topic.