- This topic has 10 replies, 3 voices, and was last updated 3 years, 9 months ago by
David.
-
AuthorPosts
-
November 30, 2021 at 11:53 am #2032118
Paul
Dear GP-Team,
as we’ve said in this post I am opening a new topic for the following question:[What] I wonder about now is if it’s possible to customize the attribute page for every author. Now, on the attribute page [from the WooCommerce shop] there is displayed the author’s name in the title and the products associated with the attribute.
Is there a way to customize it (Custom post type maybe?), so that I can add a text about the author, an image and also embed WP Show Posts shortcodes? This would be very handy and efficient as I wouldn’t have to create two separate pages for each author: one information page and one extra attribute-page showing the products.To sum up, the page should consist of the following components:
- Title (name of author)
- Featured image
- Text about author
- Products from attributes tag in WooCommerce
- Texts [Edit: Blog posts] concerning author marked with tag
The text and the featured image of the author should, on the other hand, also be displayed in the description tab on the product page (For testing purposes, I did this with WP Show Posts shortcode in the private link).
Is there a way to build a custom post type like this?
I am new to working with custom post types and php, but I’m willing to learn. Getting this to work would be very convenient in future, as there might be a lot more author pages coming up.Thanks for your help and best wishes
PaulNovember 30, 2021 at 12:14 pm #2032147Ying
StaffCustomer SupportHi Paul,
Not sure I fully understand, are you trying to build a custom static page to replace the term archive page?
If so, have you thought about using a block element to insert the info the the default term archive page which already has products listed?
Let me know 🙂
November 30, 2021 at 2:18 pm #2032286Paul
Hey Ying!
Yeah, I’ve thought about that, but I wasn’t sure if that’s the right way to go.
In that case, every author would have to have a woo-commerce-product, right? That might be a problem, as I might want to have author pages for authors who only contribute something that is published in the blog.
Please let me know what you think about it.
November 30, 2021 at 2:31 pm #2032303Ying
StaffCustomer SupportAnd I assume some of the authors who have books to sell in the store don’t write articles for the blog?
How many authors would there be?
December 1, 2021 at 2:08 am #2032895Paul
Well, some do, some might, some don’t.
Also, on the authors page there may be introduced other artists and writers (for example translators of books), who may not be tagged in the Woo Product or artists of an audio book, which will be available on spotify, but not in the store.
The number of “Woo”-authors is at nine at the moment, but there will be more (hopefully 100+ in the next 2-3 years).
I added a link to a mockup-page to illustrate approximately what I have in mind.December 1, 2021 at 6:55 am #2033242David
StaffCustomer SupportHi there,
sounds like the future scope could be quite complicated. You may want to look into the Pods plugin or a developer who specialise in that as it will allow you to create custom content types and many to many relationships.
https://en-gb.wordpress.org/plugins/pods/
For simply adding some additional stuff to the Attribute archive.
You can use a Block Element – for example the Page Hero Element type:
https://docs.generatepress.com/article/block-element-page-hero/
The Post Title can retrieve the Attribute Name and the GP Dynamic Content block can get the Term Description.
For the image – little more work involved
This plugin will give you an image field for the attributes ( and any taxonomy ):
https://wordpress.org/plugins/categories-images/And you should be able to get that image using the shortcode snippet provided here:
https://generatepress.com/forums/topic/category-image-in-header-element/#post-1783359
December 1, 2021 at 10:03 am #2033990Paul
Thankyou David, this has been great help!
I managed to add the header element, the image and the description to the attribute page.
This is exactly what I wanted and I’m fine with that for the beginning. I will have a look at pods and maybe find a developer for the future, but for now, this is good!
Now there is only one thing missing, which is the related posts. I tried adding a loop, but I don’t know how to make it “dynamic” so that it will take the attribute. Is it possible to somehow “tell” the loop-query to get all posts tagged with exactly the same name as the attribute? Then all posts concerning the author could be displayed. It would best to display them below the woo-products but I’m not sure if that is possible.
December 1, 2021 at 12:18 pm #2034362Paul
Hi David,
just a quick update: Maybe there is another problem, which is that the attribute pages might not be searchable on the website. I tried it with this plugin and also with WP Extended Search but I couldn’t get it to work. Also, I would like the author pages to be indexed by Google and I’m not sure if that’s possible with the attribute archive page?So I might settle with the follwing solution:
Build the author page with woo product by attribute loop and post loops and reusable blocks. In order to only have one page for every author, I will use redirects. This will definately be good for the next time. Meanwhile I can study CPT and implement it when I’m ready. 🙂Sorry for troubling you and thanks for your help!
December 2, 2021 at 3:27 am #2035453David
StaffCustomer SupportYeah i agree that would be a better process for today.
Glad to be of some help
December 2, 2021 at 3:56 am #2035493Paul
Thank you again, David. I’ll mark the topic as resolved.
December 2, 2021 at 4:59 am #2035586David
StaffCustomer SupportYou’re welcome
-
AuthorPosts
- You must be logged in to reply to this topic.