- This topic has 11 replies, 4 voices, and was last updated 6 months, 3 weeks ago by
David.
-
AuthorPosts
-
August 10, 2020 at 12:54 pm #1396071
adriendemonta
Dear Team,
I’m a total newbie with CPT and have created today my first one. I’m trying to build up a review site based on GP Prime template.
I’ve used the plugin CPT UI and created the CPT “review” and the Taxonomy “ranking”. I would like everything to look exactly like the blog so I have copy-pasted into my GP child Theme both files (single.php and archive.php) that I’ve renamed:
single-review.php
archive-review.phpHowever, I’m now facing two issues:
1/ When I access to the post category “Top 20” (you can find it on my site main menu), the styling does not look like the category layout of my blog (https://www…./category/cbd-guides/) – two-column, etc…
2/ When I access to both post and Top20 category, I still see all the categories of my blog. I’d like to only show the categories (taxonomies) of my CPT review.
I would really appreciate a little help. Best, Adrien
August 10, 2020 at 2:09 pm #1396137Tom
Lead DeveloperLead DeveloperHi there,
For columns, this should help: https://docs.generatepress.com/article/using-columns-in-the-blog/#adding-columns-to-your-custom-post-type
For entry meta, these should help:
https://docs.generatepress.com/article/generate_entry_meta_post_types/
https://docs.generatepress.com/article/generate-footer-meta-post-types/Let me know π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 10, 2020 at 3:37 pm #1396213adriendemonta
Thank you, Tom! Unfortunately, I tried pasting this into my functions.php but it did not work:
add_filter( ‘generate_blog_columns’,’tu_portfolio_columns’ );
function tu_portfolio_columns( $columns ) {
if ( is_post_type_archive( ‘portfolio’ ) ) {
return true;
}return $columns;
}add_filter( ‘generate_entry_meta_post_types’, function( $types ) {
$types[] = ‘my-post-type’;
$types[] = ‘review’;return $types;
} );add_filter( ‘generate_footer_meta_post_types’, function( $types ) {
$types[] = ‘my-post-type’;
$types[] = ‘review’;return $types;
} );August 10, 2020 at 3:48 pm #1396233Leo
StaffCustomer SupportDid you replace
portfolio
my-post-type
andreview
with the name of the actual post types you’ve created?Those are just examples.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 10, 2020 at 3:52 pm #1396238adriendemonta
Thanks a lot Leo! Following to your reply, I have replaced these 3 with my CPT which is “review” but it still does not work.
add_filter( ‘generate_blog_columns’,’tu_portfolio_columns’ );
function tu_portfolio_columns( $columns ) {
if ( is_post_type_archive( ‘review’ ) ) {
return true;
}return $columns;
}add_filter( ‘generate_entry_meta_post_types’, function( $types ) {
$types[] = ‘review’;
$types[] = ‘review’;return $types;
} );add_filter( ‘generate_footer_meta_post_types’, function( $types ) {
$types[] = ‘review’;
$types[] = ‘review’;return $types;
} );August 11, 2020 at 9:02 am #1397413Tom
Lead DeveloperLead DeveloperLet’s try the columns one first.
So it looks like the page you linked to is the
ranking
taxonomy page.add_filter( 'generate_blog_columns', function( $columns ) { if ( is_tax( 'ranking' ) ) { return true; } return $columns; } );
Does that add the columns to it?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 11, 2020 at 10:01 am #1397497adriendemonta
Hello Tom. It worked perfectly!!! I would have never found how to code that. I spent like 3 hours on it. I’m so thankful and excited to read how I can achieve the next step.
Thanks a lot. AdrienAugust 11, 2020 at 4:09 pm #1397930Tom
Lead DeveloperLead DeveloperAwesome, glad I could help! π
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentAugust 12, 2020 at 3:40 am #1398502adriendemonta
Dear tom, Can you help me for point 2)?
August 12, 2020 at 8:14 am #1399084David
StaffCustomer SupportHi there,
the WP core widgets are not developer friendly, they sort of do one thing – you may want to look for advanced related posts and category widgets in the WP Repo.
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/August 12, 2020 at 8:17 am #1399096adriendemonta
Dear David. Thank you so much. I’m now in touch with a dev who’s going to take over following all your good recommandations.
Really appreciated your help there.
Best, AdrienAugust 12, 2020 at 10:02 am #1399294David
StaffCustomer SupportGlad we could be of help
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/ -
AuthorPosts
- You must be logged in to reply to this topic.