[Support request] Archives display query tweaking help

Home Forums Support [Support request] Archives display query tweaking help

Home Forums Support Archives display query tweaking help

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #2154550
    Vee

    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.

    #2154589
    Ying
    Staff
    Customer Support

    Hi 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?

    #2155748
    Vee

    Hi 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:
    archive display goal. example 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:
    using site header instead of content templTE


    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.

    #2156000
    Ying
    Staff
    Customer Support

    I’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.

    #2208231
    Vee

    Hello 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.

    #2208284
    Ying
    Staff
    Customer Support

    I’m not able to log in, can you check?
    https://www.screencast.com/t/5quCKn3n

    #2217493
    Vee

    Sorry about that! Lets try again.
    Thank you.

    #2217824
    Ying
    Staff
    Customer Support

    Just to confirm, all you want is to present the CPT in this style?
    https://www.screencast.com/t/po4ZfcPz

    Have you tried using a block element - content templateto 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.

    #2217832
    Ying
    Staff
    Customer Support

    There’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 🙂

    #2217871
    Vee

    Hi 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?

    #2217933
    Ying
    Staff
    Customer Support

    The 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?

    #2221552
    Vee

    Ah 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!

    #2221606
    Ying
    Staff
    Customer Support

    Hi 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 of content template, choose after_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 under artwork 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.

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.