- This topic has 9 replies, 3 voices, and was last updated 3 years, 4 months ago by Tom.
-
AuthorPosts
-
November 20, 2020 at 5:01 am #1538756David
Hi,
Thanks in advance for your time!
I need to change the title of the CPT archive page from “Archives CPT” to “CPT” only.And I need to design the way a post is showed in archive page. Now only shows the post title and the page is 100% width, so there is no any template working. How can I edit the CPT page template and the posts with photo, title and other data in archive page?
Thank you very much.November 20, 2020 at 5:25 am #1538777DavidStaffCustomer SupportHi there,
how have you created the CPT and its accompanying templates ?
November 20, 2020 at 5:30 am #1538781DavidHi, thanks for the quick response!
The CPT is created and the CPT content is shown through a hook (generate_after_entry_content) with your Elements plugin. So I have’nt need to create template files yet.
November 20, 2020 at 2:12 pm #1539470TomLead DeveloperLead DeveloperWhere is the
Archives CPT
title coming from? Any chance you can link us to the page?When it comes to designing your post type, it really depends on your needs. You will likely want to create a custom template file for it.
November 21, 2020 at 12:10 pm #1540407DavidHi, thanks!
I have resolved the title question.The archive of the custom post type you can see it here:
https://www.ihelp.org.es/new/reto/I have created the archive-reto.php copying it from archive.php file and saving it in child theme. But there is no design of the archives pages. Do I have to create it from blank or there is anyway to copy-past a design of GeneratePress?
Thanks very much 🙂
November 22, 2020 at 12:06 pm #1541429TomLead DeveloperLead DeveloperIt’s actually using the same HTML markup and CSS as our regular archives. However:
1. It’s full width because of this custom CSS:
body .grid-container { max-width: 100%; padding-top: 0px; padding-bottom: 0px; }
2. The posts have no content/excerpt.
3. The posts have no featured images.
If you were to resolve the above, the layout should be identical to the regular archives.
November 22, 2020 at 3:41 pm #1541544DavidHi Tom, thansks!
Perfect, now I understand the problem
One last answer, in archive.php exists this line of code: generate_do_template_part( ‘archive’ );
Where is the code of this ‘archive’? I think that this would be useful to create several templates files with ‘archive-CPT’ and organize them.
Regards!November 23, 2020 at 9:23 am #1542707TomLead DeveloperLead DeveloperThat code is a wrapper for this: https://github.com/tomusborne/generatepress/blob/3.0.2/inc/theme-functions.php#L587
In your case, you can just replace it if needed like this:
get_template_part( 'content', 'something' );
November 24, 2020 at 3:47 am #1543891DavidOk, thanks Tom!
November 24, 2020 at 10:50 am #1544882TomLead DeveloperLead DeveloperNo problem!
-
AuthorPosts
- You must be logged in to reply to this topic.