- This topic has 12 replies, 2 voices, and was last updated 1 year, 11 months ago by Ying.
-
AuthorPosts
-
March 14, 2022 at 1:49 pm #2154550Vee
Hello! happy to be making some headway with a new site, and am loving the potential customization available to a non-developer with elements.
I’m using GPP, and wish to use Visual Portfolio (plugin) current query block to display my archives. (Both for posts and a CPT)
So far, I’ve got this working, except that due to the nature of content template element + archives with GPP, the query repeats.
When I select “Apply to : All posts” it is, naturally, duplicated.
example ALL-
And when I select “Apply to: first post” the remaining posts render below the first post (the VP custom query) using the default display.
Example First–Is there a way to disable or hide the ~remaining posts~ through GPP that i’m not finding?
~by remaining posts I mean all the remaining ones after the first, on the archive page. (not to hide the actual posts, just their query result that looks like a dupe after the first one)
Or is there a smarter method to accomplish my goal with a different element like a hook?
Or perhaps a PHP snippet?*I have tried adjusting the numbers in Settings>Reading to 1, however that seems to also affect the VP query, and only 1 item is displayed.(not sure if it even affects my CPT, but does affect the blog display that way)
I considered just doing this manually by inserting the VPquery into plain pages,but for perhaps obvious reasons, this is awful idea (would disallow the native category term links, and would need to be recreated each time a new category is made.)
*I have played around with using the masonry colulum display and activated it successfully with my CPT, but the VP route provides some additional functionality for images I prefer.
Much appreciated.
March 14, 2022 at 2:45 pm #2154589YingStaffCustomer SupportHi Vee,
I read the entire topic and checked the 2 links, but I’m still having a hard time to understand your issue and what you are trying to achieve.
When you say it duplicates, you mean the plugin content is duplicated?
How does it work if you don’t have content template set for posts?
March 15, 2022 at 10:55 am #2155748VeeHi Ying,
I am trying to use the archive page that is natively created by WordPress. On that page, I would like the VP gallery to display the archive, rather than how it is normally displayed.
For example, just the top part of this page:
so that the bottom part, crossed out on this screenshot, does not display.
^ This is what happens when I choose “apply to first post” with content template.When you say it duplicates, you mean the plugin content is duplicated?
yes.I understand why it does, because any item chosen to represent the list of posts, would duplicate if “all posts” is selected. if “first post” is selected it only shows that item for the first post, and renders the remaining posts in the default style.
How does it work if you don’t have content template set for posts?
It does the same thing. Example: If I choose hook or site header, it renders the posts below still. as shown here:
Essentially I would like my content template, which uses the VP gallery, to take over on the archive pages.(so that just the circled part in the first screenshot is visible)The reason I wish to do this is for the style+function of the VP post, along with the functionality of Elements to apply it to all or most archive pages, and so that when a visitor clicks on a category name, they are taken to this archive design, not a default one.
Hope this is better to help understand. Thank you.
March 15, 2022 at 4:15 pm #2156000YingStaffCustomer SupportI’m still confused, so what the VP gallery does is just to show the featured image instead of the default image + excerpt style?
Let me know.
May 3, 2022 at 12:39 pm #2208231VeeHello again.
My issue does not have to do with displaying image options.I am not sure how else to explain its other than how I did with screenshots, but let me try:
It is essentially the exact same issue this person is having:
https://wordpress.org/support/topic/disable-archive-posts-showing-up/
and that this person had:
https://generatepress.com/forums/topic/custom-category-archive-page/Except that I am using VisualPortfolio to call my CPT(artwork) posts rather than WPShowPosts that they are using. [by contrast, VisPort does not use shortcodes, it calls upon the loop I believe. Also I am using GP Elements –to place my VisPort block– before the core loop on the archives.]
In the forum thread (2nd link- OP is Nemanja), page 2,#1790082 Tom’s reply says:
Aha, that makes sense. The archive query is built before WPSP is rendered, so it’s not aware of the posts that WPSP is going to display yet.
Hmm, tough one. We would need a way to know which posts WPSP will be showing before it’s actually rendered.
I seem to be having the same problem. In my case, I have set VisPort to pull the posts from the “current query”…. which is coming from the Location I set via GPElements, eg. all ‘artwork’ archives.
Tom’s reply above seems to suggest maybe there is a way if the posts are known?I have tried a snippet to limit just 1 result per archivepage, but that also affects my VisPort results, which defeats the purpose. I think this happens because of what Tom points out.
So…. now I’m realizing that my issue is self-referential based on Tom’s point… and because of this might be a catch-22 that can’t be fixed? I hope not and that someone smarter than me can point to a solution.
I really don’t want to do this ‘static page as category archives‘ solution, as new categories,tags, etc will be being added over time by the user.
Anyone have any further ideas?
(site log-in provided in private information box)many thanks.
May 3, 2022 at 1:44 pm #2208284YingStaffCustomer SupportI’m not able to log in, can you check?
https://www.screencast.com/t/5quCKn3nMay 12, 2022 at 7:19 am #2217493VeeSorry about that! Lets try again.
Thank you.May 12, 2022 at 10:07 am #2217824YingStaffCustomer SupportJust to confirm, all you want is to present the CPT in this style?
https://www.screencast.com/t/po4ZfcPzHave you tried using a
block element - content template
to create the CPT archive page instead of using the plugin?
https://docs.generatepress.com/article/block-element-content-template/And we can provide some PHP snippets to apply columns and activate masonry for CPT archive:
https://docs.generatepress.com/article/using-columns-in-the-blog/The plugin you are using doesn’t seem to be nessasery in this case.
Let me know if I miss anything.
May 12, 2022 at 10:19 am #2217832YingStaffCustomer SupportThere’s another option is to create a child theme, then using an empty template for the cpt archive.
So the default loop won’t show at all.
Let me know what you think 🙂
May 12, 2022 at 11:24 am #2217871VeeHi Ying, Thank you. Yes, basically that is the goal.
I have actually tried your first suggestion already (made a content template and used the php for adding blog/masony etc to the CPT). I realize could use this method, however the VP has additional styling that I would prefer to use and more quickly change in the future. Also want to use that plugin in other areas of the site, so using it on archive pages would help visual consistency.If I were using WordPress with a FSE theme I could adjust archives from within the CMS, but can’t seem to find that ability when using the GP Theme.
So, a child theme sounds like the right approach!
I am familiar with creating child themes, but it’s been many years, and I never did much, just used someone else’s. … can I only include the custom archive template file to overpower the existing cpt template? How would I do this? I don’t think I need custom templates for any other site aspects, as GP elements is fantastic. 🙂 Any tips to avoid needless files in the child theme?Also….
I’ve seen tutorials for making custom templates before, but seems they are for custom coding.
Am I correct in understanding that once I create the empty template I won’t actually need to code it? I can just create it with GP Elements? That is, it will be a ‘Location’ option in Display Rules, and I can just use content template to lay it out?Thank you! Much obliged.
PS- OH… would I have to rebuild the site again? or can I keep my progress thus far made in the regular GP theme?
May 12, 2022 at 1:02 pm #2217933YingStaffCustomer SupportThe child theme path removes the default loop from the archive, I’m not sure if the plugin’s output would be affected.
The user account doesn’t have all the access to your admin panel, so I still can’t tell how that plugin works.
Can you assign admin role to the user so I can have a closer look?
May 16, 2022 at 11:33 am #2221552VeeAh I see. yes, I would need to be able to access the loop for the plugin, but not output below, the way it does on the theme archive.
Sorry for the slow reply, traveling. Yes I am assigning the admin now, it was on editor before I think. Thank you!
May 16, 2022 at 12:23 pm #2221606YingStaffCustomer SupportHi Vee,
I checked it again, the plugin outputs the loop, it’s like a query loop block.
The plugin is for adding loops to static pages, so it can NOT be used as a content template for archive page.
You can set your current block elements’ type to
hook
instead ofcontent template
, chooseafter_archive_description
as hook name.To remove the default loop, you can:
1. create a new block element, choose content template as element type, leave its content area blank.
2. Choose all the locations underartwork archives
section, publish.Then your artwork archive pages will only have the loops that added by the plugin.
Let me know if there’s anything unclear.
-
AuthorPosts
- You must be logged in to reply to this topic.